automatically changing pictures on my web page - "slideshow"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My web page has a photograph central to the page. I would like to be able to
select several pictures, maybe 3 or 4, and have a different one show up
randomly every time someone opens the page, or refreshes, or maybe change
every 15 seconds.
Anybody have an idea on how to do this?
 
The following script displays one of three pictures at random.

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

If you want more or less than three pictures, jsut enlarge or contract the
array. You may also have to adjust the path, images/.

For an example of a script that changes the picture every 5 seconds, look
near the end of this article:

Banner Ad Manager Displays Incorrectly
http://www.interlacken.com/winnt/tips/tipshow.aspx?tip=26

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)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top