www.webdeveloper.com
Results 1 to 5 of 5

Thread: Single Animated Image; Multiple URLs

  1. #1
    Join Date
    Mar 2003
    Location
    North Miami Beach, Florida
    Posts
    3

    Question Single Animated Image; Multiple URLs

    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.

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    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...

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  3. #3
    Join Date
    Mar 2003
    Location
    North Miami Beach, Florida
    Posts
    3

    Talking Do you know where I can find a good javascript?

    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.

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    I think this is what you are looking for...

    Code:
    <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>

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  5. #5
    Join Date
    Mar 2003
    Location
    North Miami Beach, Florida
    Posts
    3

    Wink Thanks!

    Thanks for the reply, but I found a script the day you responded the first time. Guess I just hadn't looked long enough.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles