How can I dynamically resize the jQuery Colorbox plugin?

前端 未结 16 1685
情书的邮戳
情书的邮戳 2020-12-13 14:14

The AJAX content loaded in a Colorbox has some JavaScript included that resizes things within the content. Colorbox determines its sizing based on the sizes before all of th

16条回答
  •  猫巷女王i
    2020-12-13 14:40

    To dynamicly resize colorbox you want to say.

    colorbox.resize({width:"300px" , height:"300px"})
    

    If you want to resize a color box that loads an Iframe you would add something like this to the head of your target document.

    $(document).ready(function(){
        var x = $('mydiv').width();
        var y = $('mydiv').height();
    
        parent.$.colorbox.resize({width:x, height:y});
    
    });
    

提交回复
热议问题