编程论坛
注册
登录
编程论坛
→
WEB前端(UI)
[求助]怎么实现当鼠标放在某一行时该行背景色和文字颜色都改变??
kirind
发布于 2006-04-02 01:41, 1455 次点击
经常在网页上看到的一个特效:
就是当鼠标放在某一行时该行背景色改变 文字颜色也改变 当鼠标移开时 颜色恢复正常状态
请问怎么实现??恳请给出代码
3 回复
#2
wxc35
2006-04-29 15:07
去了解一下dom模型,大概就鼠标移进的事件写:文档.对象.属性=属性值 移出时再把属性改为原来的样子。
#3
water123456
2006-04-30 07:40
dom模型?
#4
程序错误
2006-04-30 16:19
<html xmlns="
http://www.w3.org/1999/xhtml
">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body{margin:30px; font-size:12px}
td{ font-size:12px}
.SelBg {
color: #FFFFFF;
background-color: #0A246A;
}
</style>
</head>
<body>
<table width="182" border="0" cellpadding="0" cellspacing="0">
<tr onmouseover="this.className='SelBg'" onmouseout="this.className=''">
<td height="14">地区一</td>
</tr>
<tr onmouseover="this.className='SelBg'" onmouseout="this.className=''">
<td height="14">地区二</td>
</tr>
<tr onmouseover="this.className='SelBg'" onmouseout="this.className=''">
<td height="14">地区三</td>
</tr>
</table>
</body>
</html>
[此贴子已经被作者于2006-4-30 16:27:10编辑过]
1