在我的网站上,我打开了一个包含IFRAME内容的fancybox.是否可以在其中单击链接时更新fancybox的大小?
例如,我最初将其设置为535px宽度,当点击特定链接时,我希望将fancybox调整为900px宽度.
知道我怎么能做到这一点?
谢谢!
why*_*d.i 18
我想我有同样的问题,在我的情况下,fancybox.resize没有用,但这对我有用:
$("#lightbox").fancybox({
'hideOnContentClick' : true,
'width' : 500,
'type' : 'iframe',
'padding' : 35,
'onComplete' : function() {
$('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height
$('#fancybox-content').height($(this).contents().find('body').height()+30);
});
}
});Run Code Online (Sandbox Code Playgroud)
感谢Ian Hoar在此发布:http: //www.ianhoar.com/2011/08/25/jquery-and-fancybox-how-to-automatically-set-the-height-of-an-iframe-lightbox /
| 归档时间: |
|
| 查看次数: |
44299 次 |
| 最近记录: |