最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to wait for a popup to close in jQuery Mobile? - Stack Overflow

programmeradmin3浏览0评论

In jQuery Mobile 1.2.0 i'm using the new popup widget.

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

I obviously want to wait until the the popup closes pletely before i open it again. The close method does not provide a callback function option.

In jQuery Mobile 1.2.0 i'm using the new popup widget.

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

I obviously want to wait until the the popup closes pletely before i open it again. The close method does not provide a callback function option.

Share Improve this question asked Nov 20, 2012 at 3:34 Nadav MillerNadav Miller 4912 gold badges5 silver badges15 bronze badges 1
  • The methods for close and open should definitely have callback functions. I am aware that I can use the afterclose event, but I dont want the same action to kick off if the user quits the popup, and so I have to provide a check for that. There is nothing in the roadmap (jquerymobile./roadmap) that indicates this will be fixed. Even the versjon 1.6 adoption of the dialog widget in jQueryUI wont fix the problem. So, we'll just have to do with the somewhat cumbersome afterclose event workaround. – Gjermund B. Dahl Commented Oct 3, 2015 at 19:09
Add a ment  | 

1 Answer 1

Reset to default 5

You can use the popupafterclose event, below is the snippet on how to do it.

For more information you can look at the jQuery-Mobile Docs

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

评论列表(0)

  1. 暂无评论