Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Fancybox hideOnContentClick不工作_Jquery_Fancybox - Fatal编程技术网

Jquery Fancybox hideOnContentClick不工作

Jquery Fancybox hideOnContentClick不工作,jquery,fancybox,Jquery,Fancybox,我正在尝试将fancybox与以下设置集成。我正在链接页面上的一组链接。在每个页面上,都有一个“添加到购物车”按钮,它会触发一个AJAX事件,将产品添加到购物车中。每当单击该按钮时,fancybox就会关闭,但我希望它保持不变。我使用了hideOnContentClick,但似乎不起作用。请帮帮我。我还尝试访问jquery.fancybox-1.3.4.js对以下内容进行注释,但仍然不起作用: if (currentOpts.hideOnContentClick) {

我正在尝试将fancybox与以下设置集成。我正在链接页面上的一组链接。在每个页面上,都有一个“添加到购物车”按钮,它会触发一个AJAX事件,将产品添加到购物车中。每当单击该按钮时,fancybox就会关闭,但我希望它保持不变。我使用了hideOnContentClick,但似乎不起作用。请帮帮我。我还尝试访问jquery.fancybox-1.3.4.js对以下内容进行注释,但仍然不起作用:

        if (currentOpts.hideOnContentClick) {
            content.bind('click', $.fancybox.close);
        }
以下是我的脚本:

<link rel="stylesheet" type="text/css" href="fancybox/fancybox/jquery.fancybox-1.3.4.css" media="screen" /> 

<script type="text/javascript">
    $(document).ready(function() {

        $("a[rel=example_group]").fancybox({
            'hideOnContentClick': false,
            'overlayColor'      : '#5B8FE2',
            'overlayOpacity'    : '0.2',
            'centerOnScroll' : 'true',
            'scrolling'         : 'no',
            'autoDimensions'    : false,
            'transitionIn'      : 'none',
            'transitionOut'     : 'none',
            'titlePosition'     : 'outside',
            'autoScale'         : false,
            'height'            : '500',                    
            'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
                return '<span id="fancybox-title-over">Product ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
            }
        });
                               });
</script>

$(文档).ready(函数(){
$(“a[rel=example\u group]”)。fancybox({
“hideOnContentClick”:false,
“套色”:“5B8FE2”,
“产能过剩”:“0.2”,
'centerOnScroll':'true',
“滚动”:“否”,
“自动标注”:false,
“transitionIn”:“无”,
“transitionOut”:“无”,
“标题位置”:“外部”,
“自动缩放”:false,
“高度”:“500”,
“标题格式”:函数(标题、currentArray、currentIndex、currentOpts){
返回'Product'+(currentIndex+1)+'/'+currentArray.length+(title.length?''+title:'')+'';
}
});
});

你的意思是fancybox在点击框内或框外时关闭。@Sudhir:如果你有覆盖,那么你不能点击框外的任何链接,所以我猜他的意思是点击框内。-马特:有联系吗?