当前位置: 代码迷 >> JavaScript >> 想得到“鼠标滑过变换背景图片的效果”,该如何处理
  详细解决方案

想得到“鼠标滑过变换背景图片的效果”,该如何处理

热度:86   发布时间:2012-03-02 14:40:29.0
想得到“鼠标滑过变换背景图片的效果”
样式表:
.mouseover{background-image:url(Pic/200707/dot.jpg);}
.mouseout{}
脚本:
onMouseOver= "this.className=mouseover "  
onMouseOut= "this.className= 'mouseout ' "

如果是background-color可以得到想要的效果,如果是background-image就不行了。这个问题要怎么解决?

------解决方案--------------------
<style type= "text/css ">
<!--
.mouseover,.mouseout{height:59px; width:174px;border:1px solid #FF0000;}
.mouseover{background-image: url(logo.gif);}
.mouseout{background-image:none;}
-->
</style>
<div class= "mouseout " onMouseOver= "this.className= 'mouseover ' " onmouseout= "this.className= 'mouseout ' "> </div>


------解决方案--------------------
帮顶