简体   繁体   English

如何等待jQuery Mobile中的弹出窗口关闭?

[英]How to wait for a popup to close in jQuery Mobile?

In jQuery Mobile 1.2.0 i'm using the new popup widget. 在jQuery Mobile 1.2.0中,我正在使用新的弹出窗口小部件。

$('#my_popup').popup('close');
$('#my_popup').popup('open');

I obviously want to wait until the the popup closes completely before i open it again. 我显然想等到弹出窗口完全关闭后再打开它。 The close method does not provide a callback function option. close方法不提供回调函数选项。

You can use the popupafterclose event, below is the snippet on how to do it. 您可以使用popupafterclose事件,以下是有关如何执行此事件的代码段。

For more information you can look at the jQuery-Mobile Docs 有关更多信息,请查看jQuery-Mobile Docs。

$( "#my_popup" ).bind({
   popupafterclose: function(event, ui) { ... }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM