fancybox iframe auto resize
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();
});
});
精彩评论