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", ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.