发布网友 发布时间:2022-04-22 08:20
共1个回答
热心网友 时间:2022-04-20 05:18
var size = 5,current = 0,gx = document.getElementById("gx");
function next(){
current = (current+1)%size;
change();
}
function prev(){
current = (current+size-1)%size;
change();
}
function change(){
gx.style.backgroundImage="url(images/gx"+(current+1)+".jpg)";
}
setInterval(next,1000);
按钮