2010-09-23 112 views
2

我试图阻止fancybox窗口关闭,当用户点击 fancybox窗口之外。我在IE7上使用fancybox版本:1.3.1,我试过以下,但我还没有成功。很感谢任何形式的帮助。fancybox防止关闭点击窗外

on fancybox 1.2.6 close

jquery fancybox - prevent close on click outside of fancybox

我的代码:

<script type="text/javascript"> 
$(document).ready(function() {   
$("a.fancybox").fancybox({ 
    'width'   : '68%', 
    'height'   : '80%', 
    'autoScale'   : true, 
    'transitionIn'  : 'none', 
    'transitionOut'  : 'none', 
    'type'   : 'iframe' 
});    
}); 
</script> 

感谢

回答

7

尝试增加此选项:

'hideOnOverlayClick' : false 

cf API doc:http://fancybox.net/api

+0

谢谢你,工作。我可以发誓我曾尝试过。 – Noe 2010-09-23 14:58:25

+0

我刚刚意识到为什么它没有工作之前,有这个'虚假',而不是只是虚假没有引号。 – Noe 2010-09-23 15:03:05

+0

实际上,带引号的''false''是一个在布尔上下文中求值为'true'的字符串! ^^ – 2010-09-23 15:05:57