為什么我寫了這個for循環(huán)以后并不能切換按鈕,然后左右按鈕的切換都不行了?
?for (var i = 0; i <buttons.length; i++) {
????? buttons[i].onclick=function(){
???????? var myIndex=parseInt(this.getAttribute('index'));
???????? var offset=-768*(myndex-index);
???????? animate(offset);
???????? index=myIndex;
???????? changeButtons();
????? }??
2016-08-17
附上html看看
2016-07-15
第四行的myIndex改正了也還是不行