Simple Application of jquery Nth-child () Selector

Source: Internet
Author: User

You can easily solve this problem by using this selector. Record it here.
Below is the main Code
JS script: Copy code The Code is as follows: <SCRIPT type = "text/JavaScript">
$ (Document). Ready (
Function (){
// Add a style to Li every five lines
$ ('. Article_li Li: Nth-child (5N)'). addclass ('liborder ');
$ ('. Article_li Li: la'). addclass ('liborder ');
}
);
</SCRIPT>

HTML code: Copy code The Code is as follows: <ul class = "article_li">
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: no pilot Property Tax in Changsha: no pilot in Changsha </a>
</LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
<Li>
<Label class = "datename">
<Span> 08:37:59 </span>
</Label>
<A href = "/A/xinwenzixun/caishuidongtai/20100612/2323 .html"> Property Tax: Changsha is not piloted yet </a> </LI>
</Ul>

The specific usage will not be written here. For details, refer
Http://www.jb51.net/css/28294.html
Http://www.jb51.net/article/23617.htm
As follows:

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.