#1
  1. No Profile Picture
    Php Slave
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    475
    Rep Power
    13

    How to make a piece of an image clickable?


    Hi,

    I have this background image on my website with a right white corner on it. Is there a possibility to make only that right white corner clickable (add a href) ?

    Thanks in advance
    There are no mistakes in life....only lessons!
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2002
    Location
    Queensland, Australia
    Posts
    827
    Rep Power
    142
    It is possible. The answer, however, will be found with HTML and possibly Javascript, not PHP.

    You also haven't provided enough information for anyone to provide instructions, if that's what you wanted.
    Ooh, they have the Internet on computers now!
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    Stick a DIV or SPAN up there with no content and attach an onclick to it.

    No PHP involved at all.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Php Slave
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    475
    Rep Power
    13
    Originally Posted by ManiacDan
    Stick a DIV or SPAN up there with no content and attach an onclick to it.

    No PHP involved at all.
    Yes indeed , no PHP needed. Maybe a moderator can move it?

    About the div or span option. How can i attach an onclick on a position in a div/span? Thus not a onclick on the whole div , but only a small part.
    There are no mistakes in life....only lessons!
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,466
    Rep Power
    594
    The easiest way is to use an IDE such as Dreamweaver and the 'area' tag. It allows you to create different clickable shapes within an image such as rectangles, squares, etc. The most powerful one is 'poly' which you need and IDE to use effectively. It lets you create any oddball shape you want. I use it to make certain parts of maps clickable.

    Comments on this post

    • benno32 agrees : A good old fashioned image map
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  10. #6
  11. No Profile Picture
    Php Slave
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    475
    Rep Power
    13
    Originally Posted by gw1500se
    The easiest way is to use an IDE such as Dreamweaver and the 'area' tag. It allows you to create different clickable shapes within an image such as rectangles, squares, etc. The most powerful one is 'poly' which you need and IDE to use effectively. It lets you create any oddball shape you want. I use it to make certain parts of maps clickable.
    Great, that did the trick. Thanks alot.

    I came up with this:

    <html>
    <body>
    <img src ="./images/background.png" alt="Test map" usemap ="#testmap" />
    <map id ="testmap" name="testmap">
    <area shape ="poly" coords="318,196,318,196,341,196,318,218,318,218"
    href ="linkto.php"
    alt="Test map" />
    </map>
    </body>
    </html>
    There are no mistakes in life....only lessons!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0
    I was looking for this information myself. Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo