image swap without mouseover

L

Lisa

On my home page I want the image in the header to change
on its own (not with a mousover or click or slideshow
buttons) to another image; Can't figure out how to do it.

Thanks
 
C

chris leeds

I believe that was a java applet and is not recommended because of spotty
support for java on the client side. check out something in JavaScript like
the link that Mike posted.

HTH
 
J

Jim Buyens

I presume you want the photos to change based on time.
If so, here's a page that rotates six pictures, advanding
to the next every 5000 miliseconds.

<html>
<head>
<title>Rotate Pictures</title>
<script language="JavaScript">
picNr = 0;
picName = new Array("bear_cub.jpg",
"cow.jpg",
"dog.jpg",
"cat.jpg",
"moose.jpg",
"alligator-1.jpg");

function rotatePics(){
document.rotating.src = "images/" + picName[picNr];
if (picNr < picName.length - 1) {
picNr = picNr + 1;
}else{ picNr = 0;
} setTimeout("rotatePics();",5000);
}
</script>
</head>
<body onLoad="rotatePics();">
<img name="rotating" border="0"
src="images/alligator-1.jpg">
</body>
</html>

To use this technique yourself,

1. Put the <script> and </script> tags (and everything
between them) in the <head> section of your page.

2. Copy the <img> tag and paste it where you want the
rotating pictures to appear.

3. Copy the onLoad= attribute (and its value), then paste
it into the <body> tag in your page.

4. Change the six picture names in the picName array
to relfect the names of your pictures. You can specify
any number of pictures you like.

5. If necessary, change the path relative path "images/"
in two places.

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

Top