JQuery Mobile navigation bar code _jquery

Source: Internet
Author: User

A navigation bar consists of a set of horizontally arranged links, usually included in the head or tail.

By default, the links in the navigation bar automatically become buttons (no data-role= "button" is required).

Use the data-role= "NavBar" property to define the navigation bar:

Copy Code code as follows:

<div data-role= "Header" >
<div data-role= "NavBar" >
<ul>
<li><a href= "#anylink" >Home</a></li>
<li><a href= "#anylink" >page two</a></li>
<li><a href= "#anylink" >Search</a></li>
</ul>
</div>
</div>

By default, the width of the button is the same as its content. Use an unordered table to divide the width of a button evenly: one button is 100% wide, 2 buttons each occupy 50% width, 3 buttons per 33,3% width, and so on. However, if you specify more than 5 buttons in the navigation bar, it will be split into multiple rows (see more instances).

Activate button
When a link in the navigation bar is clicked, it gets the look that is selected (pressed).

If you want to get this look without remembering the link, use class= "ui-btn-active":

<li><a href= "#anylink" class= "ui-btn-active" >Home</a></li>

For multiple pages, you might want the selected appearance of each button to represent the page that the current user is on. To do this, add "ui-state-persist" and "ui-btn-active" to the linked class:

<li><a href= "#anylink" class= "ui-btn-active ui-state-persist" >Home</a></li>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.