Adding Navigation Buttons and Swipe Events Example

The following code shows a full example of implementing navigation buttons and swipe events to traverse three different pages. The code in lines 14–27 implement swipe event handlers that call .changePage() with transitions to handle finger swipes. Lines 38–47 implement the first mobile page, lines 48–59 implement the second mobile page, and lines 60–68 implement the third. Each of the pages has one or two navigation buttons in the header. Figure 14.2 illustrates the multipage app:

01 <html> 02 <head> 03   <title>Python Phrasebook</title> 04   <meta charset="utf-8" /> 05   <meta name="viewport" content="width=device-width, 06     initial-scale=1"> 07   <script src="../js/jquery-2.0.3.min.js"></script> ...

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.