How to make a tab interface with jquery

Source: Internet
Author: User

The optional tabbed interface is one of the larger UI components that are applied to the local desktop . Luckily, jQueryUI makes them easy to implement. Here's how to get them up and running quickly.

The basic structure of HTML is as follows:

<div id= "Tab_wrapper" >
       <ul>
              <li><a href= "#tab1" >tab 1</li>
              <li> <a href= "#tab2" >tab 2</li>
       </ul>
       <div id= "tab1" >
              tab 1 content here ...
       </div1>
       <div id= "tab2" >
              tab 2 content here ...
       </div1>
</div>

These anchors are designated as labels by a single ID div, and the list of labels is displayed on the page tab. When a user clicks a link, it selects the tab. Only a single line of jquery code can transform this HTML into a tabbed interface:

$ (function () {
  $ ("#tab_wrapper"). tabs ();

The

. By using the anchor point to the ID of another page, instead of an item on the screen, click Tab it loads the resource automatically, and the content is loaded with Ajax. demo code: handles errors on a server that has a fallback function.

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.