我在页面加载时注册多个featherlight实例
jQuery('.feedback').featherlight(jQuery( "#feedback-box" ), { closeIcon: 'close'});
jQuery('#imprint').featherlight(jQuery( "#imprint-box" ), { closeIcon: 'close'});
当一个盒子被打开时,我想先关闭所有其他打开的盒子。
我怎样才能实现这个目标?
编辑:我尝试过此操作,但不起作用。
$('.feedback').featherlight($( "#feedback-box" ), {
closeIcon: 'close',
beforeOpen: $.featherlight.close()
});
最佳答案
您希望 beforeOpen
成为一个函数...
使用您提供的代码,您会在控制台中收到错误,不是吗?
你需要写成:
// ...
beforeOpen: function() { $.featherlight.close() }
关于javascript - 在打开新窗口之前关闭所有打开的 Featherlight 窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30742589/