当前位置: 首页 > 工具软件 > FancyBox2 > 使用案例 >

fancybox禁止通过点击背景关闭窗口 Disable fancyBox 2 from closing when clicking the backgroun...

上官高逸
2023-12-01

For version 2.x use

$(".fancybox").fancybox({
    closeClick  : false, // prevents closing when clicking INSIDE fancybox
    helpers     : { 
        overlay : {closeClick: false} // prevents closing when clicking OUTSIDE fancybox
    }
 });
 

if closeClick is set to true (default) fancybox will close if clicking over the content so with these two combined options the only possible way to close fancybox is with the close (X) button

hideOnOverlayClick and hideOnContentClick are options for Fancybox v1.3.x

 

原文:http://stackoverflow.com/a/8404587/4484798

 类似资料: