鼠标划过时整行变色代码
2012-12-21 16:01
183 查看
aaa | aaa | aaa | aaa |
aaa | aaa | aaa | aaa |
aaa | aaa | aaa | aaa |
aaa | aaa | aaa | aaa |
aaa | aaa | aaa | aaa |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script> function overIt(){ var the_obj = event.srcElement; if(the_obj.tagName.toLowerCase() == "td"){ the_obj=the_obj.parentElement; the_obj.oBgc=the_obj.currentStyle.backgroundColor; the_obj.oFc=the_obj.currentStyle.color; the_obj.style.backgroundColor='#71BAF0'; the_obj.style.color=''; } } function outIt(){ var the_obj = event.srcElement; if(the_obj.tagName.toLowerCase() == "td"){ the_obj=the_obj.parentElement; the_obj.style.backgroundColor=the_obj.oBgc; the_obj.style.color=the_obj.oFc; the_obj.style.textDecoration=''; } } </script> </head> <body> <table border=1 width=400 onmouseover="overIt()" onmouseout="outIt()"> <tr bgColor=#111111> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgColor=#222222> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgColor=#333333> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgColor=#444444> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td></tr> <tr bgColor=#555555> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> </table> </body> </html>
相关文章推荐
- js隔行变色、鼠标划过变色代码
- 设置表格奇偶行不同颜色,鼠标划过变色的javascript代码
- 鼠标划过实现延迟加载并隐藏层的js代码
- 向上逐行滚动JS代码,鼠标划过暂停
- ie和360等浏览器控制表格行根据鼠标来变色的javascript代码
- 鼠标滑过图片显示半透明文字,边框变色代码
- 列表鼠标划过后变色,选中后更改颜色
- 精通js部分代码应用--鼠标经过tr变色
- jquery实现table鼠标经过变色代码
- 阴影效果CSS收藏+按钮鼠标移上缓慢变色代码
- 一个简单但常用的表格样式--鼠标划过行变色--简洁实现
- 写得不错的jquery table鼠标经过变色代码
- GridView 鼠标划过行变色的几种方法
- jQuery插件实现表格隔行变色及鼠标滑过高亮显示效果代码
- jQuery隔行变色鼠标划过高亮度显示
- css隔行换色和鼠标划过变色
- 一个简单但常用的表格样式--鼠标划过行变色--简洁实现
- 写得不错的jquery table鼠标经过变色代码
- JS+DIV实现鼠标划过切换层效果的实例代码