雪碧图x=0 时是点击前的样式, x=100px 时是点击后的样式,
点击前
img1
background: url("../images/images.png") no-repeat scroll 0 -94px;
img2
background: url("../images/images.png") no-repeat scroll 0 -188px;
img3
background: url("../images/images.png") no-repeat scroll 0 -282px;
点击后
img1, img2,img3分别是
background: url("../images/images2.png") no-repeat scroll 100px -94px;
background: url("../images/images.png") no-repeat scroll 100px -188px;
background: url("../images/images.png") no-repeat scroll 100px -282px;
如何编写代码?最好是jquery不是原生的
点击这里看 demo