jQuery Facebox 延迟
我的网站上需要一个非常快速且轻量级的基于 jquery 的模态框,我正在查看 Facebox http://famspam.com/ facebox
这是一个不错的插件,看起来又快又轻,但我想我仍然可以去掉一些我不需要的功能。例如,我不需要它来使用正则表达式和查找照片,因此我删除了这部分代码,而且我也不希望每当您单击任意位置或转义键时该框都会关闭。我已经部分完成,我删除了使转义键关闭框的代码,但我还没有弄清楚如何使其仅以编程方式关闭或仅在单击关闭按钮时关闭,现在它会在框外的任何单击时关闭。
现在我有一个问题我还没有弄清楚,代码中似乎有 2 个点控制淡入和淡出框的延迟,它们被设置为 200,我将它们更改为 0 并尝试了几个其他数字组合,但我似乎无法使速度更快(延迟更少)。
有谁知道如何消除打开 Facebox 的延迟?另外,当您单击框外的任何位置时,如何禁止它关闭?
I need a very FAST and lightweight jquery based Modal box on my site, I am looking at Facebox http://famspam.com/facebox
It is a nice plugin and it seems fast and lightweight but I think I can still strip out some of the features I do not need. For example I do not need it to use regex and find photos, so I have removed that part of the code, also I do not want the box to close whenever you click anywhere or the escape key. I have this partially done, I removed the code that makes the escape key close the box but I have not figured out how to make it only close programaticly or when clicking the close button only, right now it closes on any click outside of the box.
Now I have one issue I have not been able to figure out yet, there appears to be 2 spots in the code that control the delay of fading the box in and out, they were set at 200 and I changed them to 0 and tried several other number combinations but I can not seem to get the speed to be faster (less delay).
Does anyone know how to remove the delay in opening a facebox? Also how to disable it from closing when you click anywhere outside of the box?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要禁止通过单击外部任意位置来关闭它,
你可以找到一个名为“overlay : true”的东西
将其更改为
"overlay : false,"
要立即关闭它,您可以找到类似
'$(document).bind('close.facebox', function() { '
在那里,将
"$('#facebox').fadeOut(function() {"
更改为
"$('#facebox').hide(function() {"
To disable closing it from clicking anywhere outside,
you can find something called
"overlay : true"
change it to
"overlay : false,"
To close it with-out delay, You can find something like
'$(document).bind('close.facebox', function() {'
there, change
"$('#facebox').fadeOut(function() {"
to
"$('#facebox').hide(function() {"
我在一个项目中使用 thickbox ,速度相当快。另请检查此列表< /a>.我建议您通过单击框外选项来保留关闭选项,这对用户来说是一个真正的帮助。
I use the thickbox for one project, pretty fast. Check also this list. I recommend you to keep the closing by clicking outside the box option, a real help for users.
我不会尝试破解 Facebox,而是尝试一些更可配置的东西。
我使用 jqModal 创建模态框,它立即显示,无法关闭除非满足某些条件等
Instead of hacking facebox, I would try something more configurable.
I've used jqModal to create modal boxes, which display instantly, can't be closed except when certain conditions are met, etc