利用鼠标事件改背景应该怎么做.高手们 ...

来源:百度知道 编辑:UC知道 时间:2024/05/10 23:56:52
<div class="newsContent" onmouseover="this.style.background='#FFF'" onmouseout="this.style.background.image='image/tab_contentBg.gif'">123</div>

看上面的语句中的onmouseout 这样做是不对的.对的方法应该怎么做
如果在表达式中又应该怎么写

背景色与背景图片两个属性是分开独立的,要两个事件一起设置
要是想去掉背景图片就要设置为none
<div class="newsContent" onmouseover="this.style.background='#FFF';this.style.backgroundImage='none'" onmouseout="this.style.background='#000';this.style.backgroundImage='url(image/tab_contentBg.gif)'">123</div>