已采納回答 / Pokeman
<...code...>我是這樣寫的,不過點擊事件函數里面index+=1和index-=1應該放在showButton();前面,如下next.onclick=function(){???? animate(-720);???? index+=1;???? showButton(); } prev.onclick=function(){???? animate(720);???? index-=1;???? showButton(); }
2016-12-09
已采納回答 / 未知電阻Rx
?<div?id="list"?style="left:-600"> ?少加了px?<div?id="list"?style="left:-600px"> 這才是正確的
2016-12-09
已采納回答 / 慕數據5775487
這里改一下就好了function Smove(a){ ? ? ? ? ?var newL=list.offsetLeft+a; ? ? ? ? ?list.style.left=newL+'px' ? ? ? ? ?if (newL<-3000) { ? ? ? ? ? list.style.left=-600+'px'; ? ? ? ? ?} ? ? ? ? ?else if(newL>-600){ ? ? ? ? ? list.style.left=-3000+'px'; ? ? ? ? ...
2016-12-07
已采納回答 / rainy_li3676598
對, 因為你的img都是在List這個div里面,所以只需要對這個DIV進行移動。 這樣DIV里面的整體就會一起移動。 如果是讓圖片平移, 那么你要對每一個圖片都要進行處理,復雜程度大大增加。。 ?
2016-12-05