改下CSS代码:
.changqi01 {
background:url(../images/changqi01.png) no-repeat center;
width:108px;
height:108px;
}
.changqi01:hover {
background-image:url(../images/changqi02.png);
}
然后去掉div的onMouseOver和onMouseOut事件,这类切换背景图片的效果直接用纯CSS就能搞定,用不着JS。
改下CSS代码:
.changqi01 {
background:url(../images/changqi01.png) no-repeat center;
width:108px;
height:108px;
}
.changqi01:hover {
background-image:url(../images/changqi02.png);
}
然后去掉div的onMouseOver和onMouseOut事件,这类切换背景图片的效果直接用纯CSS就能搞定,用不着JS。