Forum Moderators: open
it seems to function properly for a while, but suddenly theres no image to show when i reload.. when i reload again, it works..
my page is: <snip>
[edited by: korkus2000 at 6:10 pm (utc) on April 4, 2003]
[edit reason] No personal URLs please [/edit]
You have 3 items in your array. Javascript starts at 0 with arrays. You are generating numbers from 0 - 3. You only need numbers from 0 - 2.
change this
var i = Math.round(Math.random() * 3);
to
var i = Math.round(Math.random() * 2);
or add a fourth picture.
<edit>fixed typo</edit>
[edited by: korkus2000 at 6:47 pm (utc) on April 4, 2003]