[英]colorbox jquery lightbox Scroll with parent window
我正在使用colorbox jquery灯箱。
当使用以下模式打开模态时,我目前禁用了主窗口滚动
$(document).bind('cbox_open', function () {
$('html').css({ overflow: 'hidden' });
}).bind('cbox_closed', function () {
$.colorbox.remove();
$('html').css({ overflow: 'auto' });
});
但是我认为这还不够。
我想要它,以便当模式打开时将滚动从模式转移到主窗口
例如类似引导模态3: http : //jsfiddle.net/NUCgp/183/
任何帮助将不胜感激。
您是否尝试过将滚动选项设置为false?
If false, Colorbox will hide scrollbars for overflowing content. This could be used on conjunction with the resize method (see below) for a smoother transition if you are appending content to an already open instance of Colorbox.
从这里: http : //www.jacklmoore.com/colorbox/
该API还具有调整大小功能。 如果您拥有动态内容,则可以将窗口的大小调整为内容的大小,这样就不会在灯箱内引起任何滚动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.