How to detect Materialized.js modal closing event?(如何检测 Materialized.js 模态关闭事件?)
问题描述
如何检测materialized.js
的关闭事件?
我想在模式关闭时运行一些 JavaScript 代码,方法是单击模式关闭按钮或按退出按钮或单击屏幕的任何其他区域.
I want to run some JavaScript code when the modal got closed either by clicking on modal close button or pressing escape button or clicking on any other area of the screen.
推荐答案
看起来你的意思是 materializecss 框架的 modal 的关闭事件.
Looks like you mean closing event for modal of the materializecss framework.
至于 0.97.1 版本(2015 年 9 月 15 日)打开 modal 时,可以传递选项(参见:http://materializecss.com/modals.html#options),但请注意,这是一个非常具有欺骗性的描述,因为使用 lean_modal
(https://github.com/Dogfalo/materialize/issues/1464),所以它们应该只传递给 openModal.
As for 0.97.1 version (15th of September, 2015) When opening a modal, you can pass options (see: http://materializecss.com/modals.html#options), but note, that it's a very delusive description, as the options are not being saved when using lean_modal
(https://github.com/Dogfalo/materialize/issues/1464), so they should be passed only to openModal.
总结一下:
var onModalHide = function() {
alert("Modal closed!");
};
$("#id-of-your-modal").openModal({
complete : onModalHide
});
这篇关于如何检测 Materialized.js 模态关闭事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何检测 Materialized.js 模态关闭事件?


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