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 manipulation
<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>
Another way to manipulate the background color directly
<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