我不知道如何使用增量。通過一個函數 。我不能讓該段以顯示陣列話 你如何使用增量?
<p id= "demo"
var Array = ["hello", "goodbye"];
var mimg = document.getElementById(imageArray[0]);
mimg.setAttribute('src', [index]);
//var ArrayIndex = 0;
function change() {
\t ("src", Array[Index]);
\t imageIndex++;
\t if (Index >= Array.length) {
\t \t Index = 0;
\t }
}
你必須從某個地方定義imageIndex指定的....(外changeImage功能) – sinisake
你會怎麼做呢? imageIndex指定=& – sp000142
如果你想從第一個數組成員開始,它應該是0,對吧? – sinisake