Implementing Mobile Sites with Multiple Pages

Mobile sites are composed of either a single HTML document with multiple <div data-role="page"> elements or multiple HTML documents with those elements. Each <div> element represents a single mobile page.

When using multiple pages in your mobile web site, you need to implement code and UI controls to provide ways for the user to transition from one mobile page to another. The transitions should be smooth and intuitive based on the controls and content interaction.

You can change mobile pages by linking to the second page from the first using one of two methods: adding navigation buttons or programmatically changing the page in your jQuery code.

The pages can come from <div> elements in the same web ...

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.