延时器
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | leftbtn.onclick=function(){ if(idx==0){ list.style.transition='none'; list.style.left=-5*650+'px'; setTimeout(function(){ list.style.transition='left .5s ease 0s'; idx=4; list.style.left=-idx*650+'px' },0) }else{ idx--; list.style.left=-idx*650+'px'; } } |
setTimeout里面的list.style.left的值为什么是负数
5
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧