六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 30|回复: 0

鼠标经过给tr换颜色

[复制链接]

升级  96%

12

主题

12

主题

12

主题

童生

Rank: 1

积分
48
 楼主| 发表于 2013-2-7 17:29:25 | 显示全部楼层 |阅读模式
<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>鼠标经过给tr换颜色</title></head><body><table align="center" width="100%" border="1" cellspacing="1" cellpadding="1" >  <tr style="cursor:hand " onmousemove="changeTrColor(this)">    <td align="center">1</td>    <td height="20"> 123</td>    <td height="20"> abvx</td>    <td height="20"> 465465</td>    <td height="20">546654654</td>  </tr>  <tr style="cursor:hand " onmousemove="changeTrColor(this)">    <td align="center">1</td>    <td height="20"> 123</td>    <td height="20"> abvx</td>    <td height="20"> 465465</td>    <td height="20">546654654</td>  </tr>      <tr style="cursor:hand " onmousemove="changeTrColor(this)">    <td align="center">1</td>    <td height="20"> 123</td>    <td height="20"> abvx</td>    <td height="20"> 465465</td>    <td height="20">546654654</td>  </tr></table><script type="text/javascript">function changeTrColor(obj){var _table=obj.parentNode;for (var i=0;i<_table.rows.length;i++){_table.rows[i].style.backgroundColor="";}obj.style.backgroundColor="blue";}</script></form></body></html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表