图片全屏轮播 js代码不知道为什么只播一遍就不动了

2025-05-06 12:02:41
推荐回答(1个)
回答1:

不知道你的css是什么样的,所以你的div和span我这里都看不到,我只帮你改了图的轮播,
var total = $("#solid ul").children().length;
var now = 0;
var timer = null;
$("#solid ul li").css("display","none");
foo();
timer = setInterval(foo,1000);
function foo() {
$("#solid ul li").eq(now).siblings().css("display","none");
$("#solid ul li").eq(now).fadeIn(400);
now++;
if (now == total) {
now = 0;
}
}