Php code for adding multiple links on a .gif file

Discussion in 'PHP' started by duncan107, Sep 25, 2010.

  1. #1
    Hi everyone,

    I have a technical question

    I have an 8-picture .gif banner. What I want to do is to link each of these 8 pictures to a different page. (This is a nice example: http://www.tv.com/ - all five pics of the main banner lead to different pages/shows)

    Is that possible? And if yes, how?

    Any help would be highly appreciated!

    Thanks in advance,

    Duncan
     
    duncan107, Sep 25, 2010 IP
  2. jaholden

    jaholden Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    You would need to split the GIF up into several smaller images, and link each one separately in the HTML, or use a client-side image map as described here: http://www.w3schools.com/TAGS/tag_map.asp

    James
     
    jaholden, Sep 28, 2010 IP
  3. duncan107

    duncan107 Peon

    Messages:
    106
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Last edited: Sep 28, 2010
    duncan107, Sep 28, 2010 IP
  4. jaholden

    jaholden Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Duncan,

    There's two ways of doing it. One is to slice the image up into multiple GIFs and link each piece separately. The other way is to use a client-side image map to define clickable regions on a single image using co-ordinates. The latter is a bit archaic and I couldn't be sure of the SEO implications or whether it would work on mobile devices.

    james
     
    jaholden, Sep 28, 2010 IP
  5. jaholden

    jaholden Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Oh, hang on... I get it now :D

    You've no way of knowing what frame of the GIF animation is being displayed at any point in time so you can't do it using an animated GIF.

    Your best option is to separate each banner out into a separate file and use a jQuery slideshow plugin to cycle the different banners.

    (...or use Flash, if you must)

    James
     
    jaholden, Sep 28, 2010 IP
  6. duncan107

    duncan107 Peon

    Messages:
    106
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    James,

    For the first part, you do you imply to split my original .gif into 8 smaller .gif's (one for every picture)?

    If yes, then how am I suppose to code the rotation of the images?

    Thanks again,

    Duncan
     
    duncan107, Sep 28, 2010 IP
  7. duncan107

    duncan107 Peon

    Messages:
    106
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Exactly!

    And even though I have never used any of the programs mentioned above, i ll give it a shot!

    Thanks,

    Duncan
     
    duncan107, Sep 28, 2010 IP