jquery Level Two directory select the CSS style for the current page _jquery

Source: Internet
Author: User

The

looks like this:

<div class= "navlist clear" > <span><a href= "/m/page_32.html" title= "Internal Medicine" > Internal Medicine </a></span> <span><a href= "/m/page_35.html" title= "surgery" > Surgery </a></span> <span><a href= "/m/page_" 37.html "title=" Gynecology > Obstetrics </a></span> <span><a href= "/m/page_38.html" title= "Pediatrics" > Pediatrics </a ></span> <span><a href= "/m/page_39.html" title= "ent" > Facial features </a></span> <span>& Lt;a href= "/m/page_40.html" title= "Chinese Medicine" > TCM branch </a></span> <span><a href= "/m/page_41.html" titl E= "emergency Department" > Emergency department </a></span> <span><a href= "/m/page_42.html" title= "stomatology Department" > stomatology Department </a></ span> <span><a href= "/m/page_43.html" title= "Pain Rehabilitation section" > Pain Rehabilitation Section </a></span> <span><a H ref= "/m/page_44.html" title= "Pathology Department" > Pathology Department </a></span> <span><a href= "/m/page_46.html" title= " Department of Medical Technology > Medical Technology Department </a></span> <script> var url = window.location.href; $ (". Navlist span a"). each (the function () {if (Url.indexof ($ (this). attr ("href")) > 0) {$ (this). addclass ("Curen T ")}}) </script> </div>

JS to determine whether the current page URL contains the URL in level two column

Above this jquery two level catalog selects the CSS style of the current page is the small series to share to everybody's content, hoped can give everybody a reference, also hoped that everybody supports the cloud habitat community.

Related Article

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.