How can I dynamically resize the jQuery Colorbox plugin?

前端 未结 16 1488
情书的邮戳
情书的邮戳 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:47

    When you invoke the colorbox, simply add an onComplete function to it, eg

    $('.mycolorboxes').colorbox({    
      onComplete : function() { 
           $(this).colorbox.resize(); 
      }    
    });
    

    Therefore each time content is loaded within the colorbox, it kicks off its resize function.

提交回复
热议问题