var music=["m1","m2","m3","m4","m5","m6","m7","m8","m9","m10"]; var i=0; function next(){ i=i+1; if(i=music.length){ i=0; } console.log(music.length); console.log(i); console.log(music[i]); var mp3=document.getElementById(music[i]); mp3.play(); isplay=true; document.getElementById("center").className="pause"; }
为何next()里面的i自增1不起作用,i的值还是0???
刚毅87
相关分类