Source Address: http://itfish.net/article/29790.html
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>StripingTable</title>
<script src= "Jquery-1.1.3.pack.js" type= "Text/javascript" ></script>
<!--to reference jquery in-
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#orderedlist tbody tr"). Hover (function () {
$ ("#orderedlist li:last"). Hover (function () {
$ (this). addclass ("Blue");
}, function () {
$ (this). Removeclass ("Blue");
});
});
</script>
<style>
. Blue {
Background: #bcd4ec;
}
</style>
<body>
<table id= "orderedlist" width= "50%" border= "0" cellspacing= "0" cellpadding= "0" >
<!--use class= "stripe" to identify the table that needs to use the effect--
<thead>
<tr>
<th> name </th>
<th> Age </th>
<th>QQ</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td> Deng </td>
<td>23</td>
<td>31540205</td>
<td>[email protected]</td>
</tr>
<tr>
<td> Deng </td>
<td>23</td>
<td>31540205</td>
<td>[email protected]</td>
</tr>
<tr>
<td> Deng </td>
<td>23</td>
<td>31540205</td>
<td>[email protected]</td>
</tr>
<tr>
<td> Deng </td>
<td>23</td>
<td>31540205</td>
<td>[email protected]</td>
</tr>
<tr>
<td> Deng </td>
<td>23</td>
<td>31540205</td>
<td>[email protected]</td>
</tr>
<tr>
<td> Deng </td>
<td>23</td>
<td>31540205</td>
<td>[email protected]</td>
</tr>
</tbody>
</table>
</body>
As follows:
jquery's Hover method lets the mouse pass through Li when the background changes color