Jquery's tab label practices

Source: Internet
Author: User

$ (Function () {var $ div_li = $ ("# tab-tt ul li"); $ div_li.click (function () {$ (this ). addClass ("active2") // highlight the current <li> element. siblings (). removeClass ("active2"); // remove the highlighted var index of <li> elements of other peers = $ div_li.index (this ); // obtain the index of the currently clicked <li> element in all li elements. })})


The page code is as follows:

<Div class = "orderChooseNav fn-clear mb10" id = "tab-tt"> <ul> <li id = "01" <li id = "02" <li id = ""03" <li id = "04" <li id = "05" <li id = "06" class = "active2"> <a href = "#"> all </a> </li> </ul> </div>


This article from the "Blue Ocean" blog, please be sure to keep this source http://xqsea.blog.51cto.com/5628704/1297574

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.