Changing Pages with Swipe Event Handlers

$("#image").on("swipe", function(){   . . . swipe code here . . . }); $("#pageTwo").on("swipeleft", function(){   $.mobile.changePage("#page3", {transition:"slide"}); }); $("#pageTwo").on("swiperight", function(){   $.mobile.changePage("#page1", {transition:"slide", reverse:true}); });

The second method is to use the use the $.mobile.changePage(URL, options) function call, where the URL is the link location. Table 14.3 shows the available options for the .changePage() call.

The following is an example of adding a swipeleft event handler to load a remote web page when the user left-swipes the page on the device. Notice that a transition of "slide" is used, and the reverse ...

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.