MaleModeling
11-04-2002, 02:49 PM
Hello,
I am relatively new to this, and have a situation that I am not sure how to handle elegantly. I have a modeling website with a nice logo page on my Index.html with a graphic on it, that I have multiple versions of, each laid out the same, with hotspots in two places for entry into the system, one for English Language and one for German Language. Both are using hotspots.
I want to rotate the multiple graphics when the user comes onto the site, and/or refreshes the Index.html page. This will present them with different models each time they enter the site...
The graphics are JPG, and look really great, but I currently have to hardcode the graphics into the page.
There is a way to write a Javascript bit of code that will autogenerate a random number, say, between 1 and 4, and that will allow me to put the graphic name into the call to the image, I think.
Here is the part of code that I think I did right, but am not sure:
------------------------------------------START CODE
<script language="JavaScript">
var randomnumber=Math.floor(Math.random()*4)
var mainimage="models/MainPageLogo"+randomnumber+".jpg"
</script>
</head>
<div align="center"><center>
<table border="3" cellspacing="10" cellpadding="5">
<tr>
<td valign="middle" align="center" width="612"><map name="FPMap0">
<area href="mmd_frame.htm" shape="rect" coords="587, 452, 683, 487">
<area href="mme_frame.htm" shape="rect" coords="482, 454, 571, 489">
<area href="mmd_frame.htm" shape="rect" coords="410, 545, 509, 575">
<area href="mme_frame.htm" shape="rect" coords="308, 545, 394, 577">
</map><img rectangle="(308,545) (394, 577) mme_frame.htm" rectangle="(308,545) (394, 577) mme_frame.htm" src="models/MainPageLogo1.jpg" border="0" usemap="#FPMap0" width="700" height="500"></td>
</tr>
</table>
</center></div>
--------------------------------------------------- END CODE
Where it says src="models.../MainPageLogo1.jpg" what must I do so that it randomly changes???? If I put the name of the variable in there it gives me a missing file... and no one can get onto the site....
If you can help, I would be very grateful...
Thanks!!!
Antonio Rodriguez
Photographer
http://www.MaleModeling.Net
http://www.AntonioRodriguez.Com
I am relatively new to this, and have a situation that I am not sure how to handle elegantly. I have a modeling website with a nice logo page on my Index.html with a graphic on it, that I have multiple versions of, each laid out the same, with hotspots in two places for entry into the system, one for English Language and one for German Language. Both are using hotspots.
I want to rotate the multiple graphics when the user comes onto the site, and/or refreshes the Index.html page. This will present them with different models each time they enter the site...
The graphics are JPG, and look really great, but I currently have to hardcode the graphics into the page.
There is a way to write a Javascript bit of code that will autogenerate a random number, say, between 1 and 4, and that will allow me to put the graphic name into the call to the image, I think.
Here is the part of code that I think I did right, but am not sure:
------------------------------------------START CODE
<script language="JavaScript">
var randomnumber=Math.floor(Math.random()*4)
var mainimage="models/MainPageLogo"+randomnumber+".jpg"
</script>
</head>
<div align="center"><center>
<table border="3" cellspacing="10" cellpadding="5">
<tr>
<td valign="middle" align="center" width="612"><map name="FPMap0">
<area href="mmd_frame.htm" shape="rect" coords="587, 452, 683, 487">
<area href="mme_frame.htm" shape="rect" coords="482, 454, 571, 489">
<area href="mmd_frame.htm" shape="rect" coords="410, 545, 509, 575">
<area href="mme_frame.htm" shape="rect" coords="308, 545, 394, 577">
</map><img rectangle="(308,545) (394, 577) mme_frame.htm" rectangle="(308,545) (394, 577) mme_frame.htm" src="models/MainPageLogo1.jpg" border="0" usemap="#FPMap0" width="700" height="500"></td>
</tr>
</table>
</center></div>
--------------------------------------------------- END CODE
Where it says src="models.../MainPageLogo1.jpg" what must I do so that it randomly changes???? If I put the name of the variable in there it gives me a missing file... and no one can get onto the site....
If you can help, I would be very grateful...
Thanks!!!
Antonio Rodriguez
Photographer
http://www.MaleModeling.Net
http://www.AntonioRodriguez.Com