Auto height resizing in Fancybox

前端 未结 2 1261
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 19:05

In an attempt not to hijack other posts I\'ve decided to start my own one. I\'ve been messing about for days and cannot figure out how to have the height of Fancybox

2条回答
  •  悲&欢浪女
    2020-12-10 19:55

    I know this is an old thread, but I am positive this will help other people who land here. Even if you don't have control over the iframe content, by leaving the fitToView parameter in its default value (true) and calling the Fancybox update() method on window resize:

    $(window).resize(function() { $.fancybox.update(); }); However, if you are displaying other content as well (such as images pdfs, etc.), Fancybox will automatically fit them to the size of the screen. In that case, you could of course initialize fancybox for iframes and images with different parameters.

提交回复
热议问题