图片轮流
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" );
}
本文标题:JS
本文链接:https://www.haomeiwen.com/subject/sokcsxtx.html
网友评论