display a random image on reload

admin

Administrator
Staff member
I want the visitor to view a different image on my home page when they reload.How can I get 3 random images to change on page reload. I had this scriptbut it doesn't work.<script language="JavaScript">var random=Math.round(Math.random())*1var numberA=(random)+1var numberB=(numberA)+(random)if (numberA<=2)document.write('<img src=http://forums.devx.com/archive/index.php/"2.gif">')else if (numberB<=1)document.write('<img src=http://forums.devx.com/archive/index.php/"1.gif">')else if (numberB<=3)document.write('<img src=http://forums.devx.com/archive/index.php/"5.gif">')</script>HELP!Email me if you can. Thanx!
 
Top