使用しているスライドショーのランダム関数を削除しようとしています。iRnd変数は値をローダーに渡します。私は使用しようとしましfor (i=0; i<= aImages.lenght, i++) {iRnd=i}
たが、それは仕事を成し遂げません。ランダムを取り除き、配列内の順序で画像を1つずつ取得したいだけです。
これが私のコードです:
function LoadImages()
{
/* Select a random image number and make sure this is not equal to the previous image */
while(iPrev == iRnd)
{
iRnd = Math.floor(Math.random()*aImages.length);
}
/* Show the selected image */
LoadImage(iRnd);
iPrev = iRnd;
};