最贊回答 / 任性不是罪
<...code...>寫成這樣可以實現圖片的切換,但是獲取的是buttons元素而不是buttons下的span元素,如果把注釋的那一行換成不注釋的話,就不能運行了,這是怎么回事,我前兩天用的時候,還可以的???
2016-07-20
最贊回答 / 任性不是罪
var buttons = document.getElementById('buttons').getElementsByTagName("span");這一句錯了,獲取的是buttons下面的五個按鈕,而不是buttons。
2016-07-19
最贊回答 / 善良的兔子
prev.onclick=function(){ if(!animated){ if(index==1){ index=5; }else{ index-=1; } showButton(); animate(700); } }把animared的判斷提前就好了,你試試
2016-07-17