我有一个使用 Zurb Foundation 6 创建的页面。我有一个模式设置并且工作正常。
当像这样单击元素时,我试图关闭模式..
jQuery('#test').click(function(){
jQuery('#exampleModal').foundation('reveal', 'close');
});
但这给了我以下错误消息......
Uncaught ReferenceError: We're sorry, 'reveal' is not an available method for e.
我哪里出错了?
最佳答案
foundation()
函数中的参数似乎过多。这是documentation用于关闭“显示”模式。试试这个:
jQuery('#test').click(function() {
jQuery('#exampleModal').foundation('close');
});
确保 #test
是您要单击关闭的元素的 ID,#exampleModal
是 Reveal 模式的 ID。
关于javascript - Zurb Foundation 6 - 使用 jQuery 关闭模态框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51971067/