Jqury control <ul> under <li> check effect

Source: Internet
Author: User

Here is the version that references the art-template template (unspecified)

CSS Section

. Wk_res_ul li.active A,. Wk_res_ul li:hover a{
Color: #f90!important;
}

----------------------------------------

HTML section

<ul class= "Wk_res_ul fl_ul" style= "Border-bottom:none" id= "Subject_div" ></ul>
<script type= "text/html" id= "Subject_data" >
<label class= "Ul_name" > Disciplines:</label>
<% for (var i = 0; i<subject_list.length; i++) {%>
<li onclick= "Changeshow (this.id)" id= "<%=subject_list[i].subject_id%>" >

<a><%=subject_list[i].subject_name%></a>

</li>
<%}%>
</script>

----------------------------------------

JS section

function Changeshow (ID) {
$ ("#" + ID). addclass ("active");
$ ("#" + ID). Parent ("UL"). Children ("Li"). Not ("#" + ID). Removeclass ("active");
}

----------------------------------------

This method is suitable for the page has a plurality of <ul>, in order to achieve the reuse effect, the wording is a bit perverted, the elaboration of a long time, temporarily first so write, there is a good update immediately

Jqury control <ul> under <li> check effect

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.