1. By using the onmouseover onmouseout Method 2. Discoloration using the Background-color (CSS) property 3. The color-changing label is TD (TR can only use events, color styles do not work) The first method uses style actions
<style>.tr_color{background-color: #ffffff;}. tr_color_hover{Background-color:blanchedalmond;} </style><script type= "Text/javascript" >function mover (obj) {$ (obj). Children ("TD"). each (function () { $ (this). Removeclass ("Tr_color"); $ (this). addclass ("Tr_color_hover"); })} function Mback (obj) {$ (obj). Children ("TD"). each (function () { $ (this). Removeclass ("Tr_color_hover"); $ (this). addclass ("Tr_color");})} </script> <tr onmouseover= "Mover (This)" onmouseout= "Mback (This)" > <td height= "class=" tr_ Color "></tr>
The second method operates directly on the background color
<script type= "Text/javascript" >function mover (obj) {$ (obj). Children ("TD"). each (function () { $ (this). attr ("BgColor", "#eafcd5")}) } function Mback (obj) {$ (obj). Children ("TD"). each (function () { $ (this). attr ("BgColor", "#FFFFFF")})}</script > <tr onmouseover= "Mover (This)" onmouseout= "Mback (This)" > <td height= "" bgcolor= "#FFFFFF" >< /tr>
jquery Special Effects Interlaced color