Re: Animated gif with multiple links
by Zach Bagnall <zachb(at)ihug.co.nz>
|
Date: |
Wed, 11 Feb 1998 20:16:08 +1300 |
To: |
hwg-graphics(at)mail.hwg.org |
Cc: |
jane(at)web.net |
In-Reply-To: |
|
|
todo: View
Thread,
Original
|
|
Jane Will <jane(at)web.net> said:
>Hi,
>I am trying to make an animated gif link to more than one URL.
>The animation is similar to the one on the bottom of the Microsoft site
>at:
>http://backoffice.microsoft.com/Showcase/BTS/bts_home.asp
>
>Whith each "face" change I would like to be able to change the HREF
>target. Any idea how that could be accomplished?
>
>Thanks,
>Jane
Ok try this, it works for me with NN4 but it's just plain 'ol javascript:
<html><head><title>Test: rotating href</title>
<script language="JavaScript"><!--
ImageArray = new Array( "one.jpg",
"two.jpg",
"three.jpg",
"four.jpg");
HrefArray = new Array( "http://www.one.com/",
"http://www.two.com/",
"http://www.three.com/",
"http://www.four.com/");
ImgNo=0;
function RotateImage() {
ImgNo++;
if(ImgNo==ImageArray.length)
ImgNo=0;
document.Ro.src = ImageArray[ImgNo];
}
function GoSomewhere() {
clearTimeout(id); // remove this line to make it stop rotating when clicked
window.location = HrefArray[ImgNo];
}
//--></script>
</head><body><center>
<a href="javascript:GoSomewhere();">
<img name="Ro" src="one.jpg" onLoad="id=setTimeout('RotateImage();',1000);">
</a>
</BODY></HTML>
that'll do a 1 second delay between images.
you could tidy it up some by putting the two arrays into a single 2D array.
Zach Bagnall.
===========================================================
Zach Bagnall
network information services
Ph.649-817-3230 http://zbweb.base.org/ zachb(at)ihug.co.nz
===========================================================
HWG: hwg-graphics mailing list archives,
maintained by Webmasters @ IWA