1

I have the following code

function xyz(){
nextPage(0,10);
}
function nextPage(start, end){
$( ":mobile-pagecontainer" ).pagecontainer( "change", "#newpage", {xstart:start, xend:end, transition:"slide", showLoadMsg:true} );
}

I want to pass "start" and "end" values (0 and 10 respectively) to:

$( document ).on( "pagecontainershow", function( event, data ) {
 if (data.toPage[0].id=="newpage")
{ 
 alert(data.xstart);
 alert (data.xend);
}
});

Clicking on a link transitions the screen where the rest of my code inside the above "if (data.toPage[0].id=="newpage")" condition works well. However, I am getting "undefined" alert message when accessing "xstart" and "xend". I am Using the latest jquery.mobile-1.4.5.min.js and jquery-1.11.1.min.js

Thanks in advance for your help!!

Harry
  • 275
  • 1
  • 2
  • 10

1 Answers1

0

From what I found out, you cannot pass data to "pagecontainershow" event.

I had to use "pagecontainerbeforechange" event to pass my data.

Harry
  • 275
  • 1
  • 2
  • 10