Creating a Navbar

<div data-role="navbar" >   <ul>     <li><a href="#pageTwo">Page 2</a></li>     <li><a href="#pageThree">page 3</a></li>     <li><a href="#pageFour">page 4</a></li>   </ul> </div>

Another method of navigating pages is a navbar. A navbar is a set of buttons grouped together in a single bar element. Each button links to a different mobile page.

Navbars are defined by adding the role="navbar" to a <div> and then adding a list of pages to link to using <ul>, <li>, and <a> elements. For example, the following code renders a navbar similar to the one in Figure 14.2:

<div data-role="navbar" >   <ul>     <li><a href="#pageTwo">Page 2</a></li>     <li><a href="#pageThree">page ...

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.