How can I dynamically resize the jQuery Colorbox plugin?

前端 未结 16 1653
情书的邮戳
情书的邮戳 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条回答
  •  一向
    一向 (楼主)
    2020-12-13 14:29

    Just put this code on the page that opens in the iframe:

    $(document).ready(function() {
        parent.$.fn.colorbox.resize({
            innerWidth: $(document).width(),
            innerHeight: $(document).height()
        });
    });
    

提交回复
热议问题