In this paper, we illustrate the implementation of jquery interlacing effect. Share to everyone for your reference. The specific analysis is as follows:
Use jquery to achieve the effect of alternate lines, simply like eating. Come on, let's see how simple the code is.
Copy Code code as follows:
<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8"/>
<script type= "Text/javascript" src= "Jquery-1.8.2.min.js" ></script>
<script type= "Text/javascript" >
$ (function () {
$ ("#stu Tr:even"). AddClass ("BG");
$ ("#stu tr:odd"). AddClass ("bg1");
});
</script>
<style type= "Text/css" >
#stu {width:300px;border:solid 1px green;border-spacing:0px;}
#stu th{background: #ccc;}
. Bg{background:blue;}
. Bg1{background:yellow;}
</style>
<body>
<table id= "Stu" >
<tr><th> number </th><th> name </th><th> professional </th></tr>
<tr><td>0812124</td><td> sheep and sheep </td><td> bioengineering </td></tr>
<tr><td>0812120</td><td> Yanyanyan </td><td> Software engineering </td></tr>
<tr><td>0812124</td><td> Wang Meixin </td><td> Computer </td></tr>
<tr><td>0812124</td><td> Sea Flying Silk </td><td> Business English </td></tr>
<tr><td>0812124</td><td> Song </td><td> Pharmaceutical Research </td></tr>
</table>
</body>
I hope this article will help you with your jquery programming.