现在的位置: 首页 > 综合 > 正文

td 鼠标事件改变背景色

2014年07月14日 ⁄ 综合 ⁄ 共 361字 ⁄ 字号 评论关闭

td中onmouseover\onmouseout改变背景色和背景图片
<table><tr><td width="100" height="100" onmouseover="style.backgroundColor='#C86F70'" onmouseout="style.backgroundColor='#DDC676'" bgcolor="#DDC676">文字</td></tr></table>

鼠标经过时改变背景图片

<table><tr><td width="100" height="100" onMouseOver="this.background='1.gif';" onMouseOut="this.background='2.gif';" background="2.gif">文字</td></tr></table>

抱歉!评论已关闭.