JQuery Mobile navigation bar code

Source: Internet
Author: User

A navigation bar consists of a group of Horizontally arranged links, which are usually included in the header or tail.

By default, links in the navigation bar are automatically converted to buttons (data-role = "button" is not required ").

Use the data-role = "navbar" attribute to define the navigation bar:
Copy codeThe Code is 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 button width is the same as its content. Use an unordered list to evenly divide the width of a button: one button occupies 100% of the width, two buttons each occupy 50% of the width, and three buttons each occupy of the width, and so on. However, if you specify more than five buttons in the navigation bar, multiple rows are split (View "more instances ").

Activation button
When a link in the navigation bar is clicked, it will get the appearance of the selected (pressed.

If you want to get this appearance without worrying about the link, use class = "ui-btn-active ":

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

For multiple pages, you may want the selected appearance of each button to represent the page of the current user. 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.