当前位置: 代码迷 >> ASP.NET >> 简单的JS有关问题,送分
  详细解决方案

简单的JS有关问题,送分

热度:8666   发布时间:2013-02-26 00:00:00.0
简单的JS问题,送分
<script>
function   On_M(obj)
{
        obj.style.background= 'images/r04.gif ';
}
function   On_O(obj)
{
        obj.style.background= 'images/r03.gif ';
}
</script>
<div   onmousemove= "On_M(this); "   onmouseout= "On_O(this); "   style= "background-image:url( 'images/r03.gif ');   width:149px;   height:27px;   margin-top:1px; "   >
</div>

这样子为啥出错...
obj.style.background=url( 'images/r04.gif ');也是错


------解决方案--------------------------------------------------------
function On_M(obj)
{
obj.style.backgroundImage= 'url(images/r04.gif) ';
}
function On_O(obj)
{
obj.style.backgroundImage= 'url(images/r03.gif) ';
}


这样估计也可以
{
obj.style.backgroundImage= "url( 'images/r04.gif ') ";
  相关解决方案