O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required