<script>
var p1=document.getElementById("p1");
var p2=document.getElementById("p2");
var p3=document.getElementById("p3");
function exchange1(){
p1.style.display="none";
p2.style.display="block";
setInterval(exchange2,2000);
}
function exchange2(){
p2.style.display="none";
p3.style.display="block";
setInterval(exchange3,2000);
}
function exchange3(){
p3.style.display="none";
p1.style.display="block";
setInterval(exchange1,2000);
}
exchange1();
</script>
<div class="Float">
<img class="On" src="" id="p1">
<img class="Hide" src="" id="p2">
<img class="Hide" src="" id="p3">
</div>
3 回答
已采纳
几核
TA贡献5条经验 获得超3个赞
看明白你的意思了,是每个exchange函数在定时中执行后执行下一个exchange,你把每个exchange函数里的setInterval都改成setTimeout,毕竟不能同时开三个无限循环定时器╮( ̄▽ ̄"")╭
添加回答
举报
0/150
提交
取消