JS-商品图片点击轮换

//小图预览区域图片轮换键
const LIWIDTH=62;
var moveCount=0;
document.getElementById("btForward").onclick=function(){
if(this.className=="forward_disabled"){
return;
}
moveCount++;
iconList.style.left=moveCount*LIWIDTH*(-1)+"px";
document.getElementById("btBack").className="backward";
if(moveCount>=imgList.length-5){
this.className="forward_disabled";
}
}
document.getElementById("btBack").onclick=function(){
if(this.className=="backward_disabled"){
return;
}
moveCount--;
iconList.style.left=moveCount*LIWIDTH*(-1)+"px";
document.getElementById("btForward").className="forward";
if(moveCount<=0){
this.className="backward_disabled";
}
}

上一篇:Java面向对象---重写(Override)与重载(Overload)


下一篇:Java重写(Override)与重载(Overload)