点空白处 不关闭对话框 必须点关闭按钮或Esc
1.Add one parameter in settings
$.extend($.facebox, {
settings: {
opacity : 0.5,
overlay : true,
modal : true, //New parameter
........
}
2. Modify the function showOverlay()
replace the line .click(function() { $(document).trigger
('close.facebox') })
with .click(function() {
if ($.facebox.settings.modal != true)
$(document).trigger('close.facebox')
})
本文介绍了如何通过调整facebox插件设置和修改showOverlay函数,实现用户只需点击空白处而不触发关闭按钮或按下Esc键即可关闭对话框的功能。通过新增参数`modal`和调整事件触发逻辑,可以实现在不影响现有功能的基础上,增加这一便捷操作。

278

被折叠的 条评论
为什么被折叠?



