jquery fancybox - prevent close on click outside of fancybox(jquery fancybox - 防止在fancybox之外点击关闭)
问题描述
我正在为我的模态窗口使用 Fancybox 插件.似乎无论我使用什么选项,当用户在fancybox 模态窗口(灰色区域)之外单击时,我都无法阻止fancybox 模态窗口关闭.
I'm using the Fancybox plugin for my modal windows. It seems like no matter what options I use I can't prevent the fancybox modal window from closing when the user clicks outside of the fancybox modal window (grayed out area).
有没有办法强制用户点击我触发关闭事件的 X 或按钮?这似乎应该很简单,所以我希望我只是看错了示例.
Is there a way to force the user to click the X or a button that I trigger the close event? This seems like it should be simple so I'm hoping I'm just reading the examples wrong.
我试过 hideOnContentClick: false
但这似乎对我不起作用.有什么想法吗?
I've tried hideOnContentClick: false
but that doesn't seem to be working for me. Any ideas?
推荐答案
没有办法.您将不得不更改源代码.
There is no option for that. You will have to change the source code.
在 jquery.fancybox-1.2.1.js 中,你需要在 _finish 方法中注释掉(或删除)第 341 行:
In jquery.fancybox-1.2.1.js you need to comment out (or delete) line 341 in the _finish method:
//$("#fancy_overlay, #fancy_close").bind("click", $.fn.fancybox.close);
这篇关于jquery fancybox - 防止在fancybox之外点击关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:jquery fancybox - 防止在fancybox之外点击关闭


基础教程推荐
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01