JQuery Mobile receives popup for download on download page

I am using new pop functions for JQM. Running a popout with the click of a button is simple, but how can I get a popup to load on a page?

JQM reports that you can initialize popout via:

$( "#myPopupDiv" ).popup( "open" )

I tried this using the code below, but can't make it work.

$(document).bind("mobileinit", function(){
$( "#myPopupDiv" ).popup( "open" )
});

Here is a working demo using a video in popout and a button to launch it.

http://jsfiddle.net/fxakH/

If someone can help make this run when the page loads, it will be very appreciated. Thank.

+5
source share
3 answers

"mobileinit" . " pageinit"?

$(document).bind("pageinit", function(){
    $( "#myPopupDiv" ).popup( "open" )
});
0

, .

,

, pageinit , , . . .

//script to be called on add seat page
$( document ).delegate("#addseat-page", "pageinit", function() {
  $("#vipPopup").popup(); //vip popup
  $("#openvipPopup").trigger("click"); //openvipPopup is the id of the anchor for popup
});

.

0

All Articles