0

I have html page with a few jquery mobile pages as;

<div data-role="page" id="page1"> 


<div data-role="page" id="page2"> 

With a click of a button I wanted to use the following code to goto 2nd page from the 1st page.

 $.mobile.changePage('#page2', { 
                transition: 'slideup'       
            }

           );

But the site http://api.jquerymobile.com/jQuery.mobile.changePage/ says;

Note: jQuery.mobile.changePage is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Use the pagecontainer widget's change() method instead.

How to use this to change a page on a button click.

user2994762
  • 115
  • 1
  • 2
  • 10

1 Answers1

0

As said on jquery 1.5 doc you can use this code inside a click event: $( ":mobile-pagecontainer" ).pagecontainer( "change", "#page2");

ClemSndr
  • 295
  • 1
  • 5