Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wait for a popup to close in jQuery Mobile?

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 completely before i open it again. The close method does not provide a callback function option.

like image 200
Nadav Miller Avatar asked Nov 20 '12 03:11

Nadav Miller


1 Answers

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) { ... }
});
like image 135
Dilberted Avatar answered Sep 22 '22 19:09

Dilberted