定义两个方法:
<script type="text/javascript">
/*设置导航栏处的鼠标移出和移入时背景色的变化 */function changeBG(o) {
o.style.backgroundColor = "#5C75AA";
}
function changeBG2(o) {
o.style.backgroundColor = "";
}
</script>
在页面中的引用:
<ul class="home_navi">
<li οnmοuseοver="changeBG(this)" οnmοuseοut="changeBG2(this)"><a
class="top" href="/xiaonei/login.do?flag=logout">首页</a>
</li>
......
</ul>
移入时的效果:
移除后的效果:
如果不定义方法,直接在标签中实现的话,如下:
<td>
<a href="javascript:void(0);" class="xh" οnclick="readgt(this)" id="留言id号代填"
οnmοuseοver="this.style.color='#FFFFFF';this.style.backgroundColor='#3B5888'"
οnmοuseοut="this.style.color='#B1BDD6';this.style.backgroundColor='#FFFFFF'"
style="color: #B1BDD6; font-weight: bold; text-decoration: none">×</a>
</td>