开发者

fancybox iframe auto resize

开发者 https://www.devze.com 2023-02-04 12:16 出处:网络
is it poss开发者_运维知识库ible to set the width and height to auto in a fancybox iframe? thanksUnfortunately not. You can, however, do the following:

is it poss开发者_运维知识库ible to set the width and height to auto in a fancybox iframe?

thanks


Unfortunately not. You can, however, do the following:

On iframe resize, pass its new dimensions to a function within its parent that adjusts the fancybox accordingly. Will only work if parent & iframe share the same domain due to security restrictions.


If you want to click a link it opens in the same box and resize it so I did:

Inside the box I put the main content + the main link that will open the User, when clicking on the link instead of opening the address he only do a $ ('#main').hide(); and $('#secundary').show();

For me it was sufficient ;)

$(function() {

   $('.link').click(function(e) {
     e.preventDefault();
     $('#main').hide();
     $('#secundary').show();
   });

});
0

精彩评论

暂无评论...
验证码 换一张
取 消