两个如何合并成一个?
function rightClick(){
index -= imgCount;
if(index < 0)
{
index = 0;
return;
}
document.getElementById("img1").setAttribute('src', imgs[(index)%3]);
document.getElementById("img2").setAttribute('src', imgs[(index + 1)%3]);
document.getElementById("img3").setAttribute('src', imgs[(index+2)%3]);
}
function leftClick(){
index += imgCount;
if(index > imgs.length){
index = imgs.length;
return;
}
document.getElementById("img1").setAttribute('src', imgs[(index)%3]);
document.getElementById("img2").setAttribute('src', imgs[(index +1)%3]);
document.getElementById("img3").setAttribute('src', imgs[(index+2)%3]);
}
摇曳的蔷薇
阿晨1998
婷婷同学_
相关分类