简单的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 ') ";