用demo通过点击切换图片路径
html:
<img src="data:images/driving.png" class="driving"/>
js:
var imgArr =['图片1路径','图片2路径'];(数组下标从0开始)
var index =0;
$(".driving").click(function(){
if (index==0) {
index=1;
}else{
index=0;
}
$('.driving').attr('src',imgArr[index]);