Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize width of fancybox after AJAX request

I'm trying to resize the width of fancybox (v1.3), but I don't know how to do this. The width should change after I receive dynamic content with a jQuery ajax request. The height is resized automatically. Can someone help me with this?

<!-- Fetch action lines of an action  -->
<script type="text/javascript">

    $('#actionType').change(function() {

        var actionTypeId = $(this).children(":selected").attr("id");

        $.ajax({
            type: "POST",
            cache: false,
            url: "/ajax/actionLines.php",
            data: {actionTypeId: actionTypeId},
            success: function(data) {
                $("#actionBlock").html(data);
            }
        });
    });
</script> 
like image 981
Ben Avatar asked Nov 02 '22 19:11

Ben


1 Answers

You must call the update function after putting in the content.

$.fancybox.update();
like image 58
geeky_monster Avatar answered Nov 25 '22 08:11

geeky_monster