SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Apr 24, 2001, 14:22 #1
- Join Date
- Mar 2001
- Location
- Panhandle of Florida (White Sand/Brown Skin)
- Posts
- 147
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
trying to build a page that loads one of four random images in the top of the page...
can anyone refer me to the best mathod of doing this?
and a tutorial maybe?
thanks!!!
-SeFu-
-
Apr 24, 2001, 14:28 #2
- Join Date
- Mar 2001
- Location
- Panhandle of Florida (White Sand/Brown Skin)
- Posts
- 147
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
what am i doing wrong here???
Code:<script language="JavaScript"> TopLogo1 = new Image(); TopLogo1.src = "images/top_right.gif"; TopLogo2 = new Image(); TopLogo2.src = "images/top_right2.gif"; TopLogo3 = new Image(); TopLogo3.src = "images/top_right3.gif"; var TopRight = new Array(2) TopRight[0] = TopLogo1 TopRight[1] = TopLogo2 TopRight[2] = TopLogo1 var randomNumber = Math.floor(Math.random()*10); var modNumber = randomNumber %3; </script> <body> <table valign="top" width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left" width="149"><img src="images/top_left.gif" width=149 height=153 border=0 alt="East Coast Customs Car Club"></td> <td background="images/top_bground.gif" width="100%"><br></td> <script language="JavaScript"> document.write("<td align='right' width='258'><img src=' " + TopRight[modNumber] + "width=258 height=153 border=0 alt=''></td>") </script> </tr> </table>
but for some reason... when i load this page, i get a no show image in the top right...
anyone have a idea on what im doing wrong?
thanks!
-
Apr 24, 2001, 14:42 #3
- Join Date
- Mar 2001
- Location
- Panhandle of Florida (White Sand/Brown Skin)
- Posts
- 147
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ok i found it...
i spelled Array "Arraoy" lol
Bookmarks