日期:2014-05-18  浏览次数:20744 次

谁知道CSDN的贴子列表那种鼠标移动改变背景颜色的效果吗?
如题

------解决方案--------------------
<BR><center>
将鼠标移过来看效果!
<BR>
<BR>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="50">
<tr> 
<td onMouseOver=this.style.backgroundColor='#99CC66' onMouseOut=this.style.backgroundColor='' bgcolor="#6699FF">&nbsp;</td>
</tr>
<tr> 
<td>&nbsp;</td>
</tr>
<tr>
<td onMouseOver=this.style.backgroundColor='#FFFF99' onMouseOut=this.style.backgroundColor='' bgcolor="#FFCCFF">&nbsp;</td>
</tr>
</table>

你可以在这里看看演示http://www.sucai86.com/texiaofile/1051_view.htm

以是是代码,关键的部分就是onMouseOver和onMouseOut

不过不知道你注意到csdn的这个表格样式没有?它在变色的时候有一个渐变的效果,这一点我不知道是怎么实现的
------解决方案--------------------
可以用js实现
每隔一个timeout的时间让颜色改变一点点