admin管理员组

文章数量:1387440

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) { ... }
});

本文标签: javascriptHow to wait for a popup to close in jQuery MobileStack Overflow