Ajax-Driven Navigation
In the multi-page example above (see Listing 2–3) we saw how jQuery Mobile navigates from one internal page to another. When the multi-page document was initialized, both internal pages were already added to the DOM so the page transition from one internal page to the other was extremely fast. When navigating from page to page we can configure the type of transition to apply. By default, the framework will apply a "slide"
effect for all transitions. We will discuss transitions and the types of transitions we can choose from later in the chapter.
<!-- Navigate to an internal page -->
<div data-role="content">
<a href="#contact" data-role="button">Contact Us</a>
</div>
The navigation model is different when a single-page ...
Get Pro jQuery Mobile 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.