JS
2017-09-12 本文已影响0人
maocy
图片轮流
var myImage = document.querySelector('img');
var i=0;
myImage.onclick = function() {
if(i==3){
i=0;
}
i++;
myImage.setAttribute ('src',"images/"+i+".jpg" );
}
var myImage = document.querySelector('img');
var i=0;
myImage.onclick = function() {
if(i==3){
i=0;
}
i++;
myImage.setAttribute ('src',"images/"+i+".jpg" );
}