O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Page Change Transitions

. . . in HTML . . . <a data-role="button" data-transition="slide">Next</a> <a data-role="button" data-transition="slide"   data-direction="reverse">Prev</a> . . . in jQuery . . . $.mobile.changePage("#next", {transition:"slide" }); }); $.mobile.changePage("#prev", {transition:"slide",   reverse:true }); });

Transitions are added to page changes by adding the data-transition attribute to the <a> link or other element that is generating the transition. You can also specify transition in the options element if you are calling .changePage(). For example:

<a data-role="button" data-transition="slide">Next</a>

or

$.mobile.changePage("#next", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required