读书人

如用利用CSS使用鼠标经过时更换背景

发布时间: 2012-01-05 22:36:54 作者: rapoo

如用利用CSS,使用鼠标经过时更换背景图片
n
{
background-image:url(images/1.gif);
background-repeat:no-repeat;
background-position:center;
}
.m
{
background-image:url(images/2.gif);
background-repeat:no-repeat;
background-position:center;
}

<table height="100px" width="100px">
<tr class="n" onmousemove="this.classname='m'" onmouseout="this.classname='n'">
<td >aaaaa</td>
</tr>
</table>



这样为何没反应呢

[解决办法]
onmousemove换成onmouseover
this.classname换成this.className

读书人网 >asp.net

热点推荐