Click to See Complete Forum and Search --> : Single Animated Image; Multiple URLs
KingLeo
03-18-2003, 02:31 PM
I like what I've read so far, hoping for solutions! I have a pop-up ad that I want to share with three advertisers. My solution to this is an animated .gif. However, I want each image to link to a different part of my website. Can this be done?
I have researched javascripts, but honestly, I don't know what I am looking for and having found some slideshows, don't know how to fill in the code.
Please, please, please let me get what I want.
Are you talking about each frame of the animated .gif? If so, you are not going to want to use an animated .gif for this, but a javascript that will run through your images, displaying them with the correct links...
KingLeo
03-19-2003, 08:02 AM
Thank you for your reply. I was kinda expecting that response. Now for the million dollar question: Where can I find a script that will do that? I have searched javascript.com and scriptsearch.com, to name a few. I have found slideshow scripts, but don't know what variable information is to be changed; specifically, see no place to put the different urls. Can you refer me somewhere?
Alas, it's time like this I wish I knew javascripting.:D
I think this is what you are looking for...
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
//Set up images
img1 = new Image()
img1 = "one.gif"; // same as image in the <span>
img2 = new Image()
img2 = "two.gif";
img3 = new Image()
img3 = "three.gif";
//Number of seconds before images rotate
seconds = "2";
function imgOne()
{
document.getElementById("mypics").innerHTML = '<a href="http://www.w3c.org"><img src="'+img1+'" name="myimg" border=0></a>';
setTimeout("imgTwo()", seconds * 1000);
}
function imgTwo()
{
document.getElementById("mypics").innerHTML = '<a href="http://www.netscape.com"><img src="'+img2+'" name="myimg" border=0></a>';
setTimeout("imgThree()", seconds * 1000);
}
function imgThree()
{
document.getElementById("mypics").innerHTML = '<a href="http://www.google.com"><img src="'+img3+'" name="myimg" border=0></a>';
setTimeout("imgOne()", seconds * 1000);
}
</script>
</head>
<body onload="imgOne();">
<span id="mypics"><a href="http://www.w3c.org"><img src="one.gif" name="myimg" border=0></a></span>
</body>
</head>
KingLeo
03-21-2003, 02:32 PM
Thanks for the reply, but I found a script the day you responded the first time. Guess I just hadn't looked long enough.