日期:2014-05-17  浏览次数:20541 次

this.background的兼容性问题
onmouseover="this.background='images/menubgred.jpg'" onmouseout="this.background=''"在IE下面是正常的,但是换了不是IE内核的浏览器就不正常了,肯定是兼容性的问题,应该怎么写才能通用呢??求解

------解决方案--------------------

onmouseover="this.style.backgroundImage='url(images/menubgred.jpg)'" onmouseout="this.style.backgroundImage=''"
我去试了一下,要这样写才行