Random Pictures upon Loading

S

SPR

Morning,

Is there any way to get FP2000 to choose a random picture
from a list, each time the web page loads?

Instead of getting the same image each time someone comes
to the page, I would like it to be slightly different.

Cheers ! :)
 
J

Jim Buyens

-----Original Message-----
Morning,
Howdy.

Is there any way to get FP2000 to choose a random
picture from a list, each time the web page loads?

Instead of getting the same image each time someone
comes to the page, I would like it to be slightly
different.

Sure. If you have a Microsoft Web server, you can use
either of the techniques described at:

http://www.interlacken.com/winnt/tips/tipshow.aspx?tip=26

Otherwise, or if you'd just prefer JavaScript, add this
script where you want the variable pictures to apepar.

<script>
pics = new Array("sample10.jpg",
"sample11.jpg",
"sample12.jpg");
curDate = new Date();
curTim = curDate.getTime();
picNum = curTim % pics.length;
document.write("<img src='photos/" + pics[picNum] + "'>");
</script>

Here are two tips to keep in mind when using this script:

o You can specify as many pictures as you want in the
statement that begins on line 2.

o In the second line from the bottom, be sure to specify
the correct path from the page that uses the script
to the folder that contains the pictures.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
Top