tags:

views:

30

answers:

2

I have a transparent PNG sitting in a DIV on top of a list of links and I would like to know if there is any way to allow a user to click on any of those links currently sitting behind the image with jQuery? The image is large enough that it is covering the DIV below it at all times.

<div id="links"><a href="#">Link</a></div>    
<div id="image"><img src="image.png" alt="" border="0"></div>

I'm totally new to the world of jQuery so I'm still learning and can't quite grasp how to do this. Any help would be appreciated!

+1  A: 

If the image is obstructing the links, then the user cannot physically click them. You would have to give them a higher z-index, or perform programmatic clicks instead.

Jonathan Sampson
What are programmatic clicks? I haven't heard of that before.
Tim
@Tim: What I mean is invoking a click with code: `$("a.mylink").trigger("click")` for instance.
Jonathan Sampson
A: 

You could simply use an Image Map:

http://www.w3schools.com/TAGS/tag_map.asp

Order you could locate the links over the image by using z-index:

http://www.w3schools.com/Css/pr_pos_z-index.asp

Nissan Fan
I had thought about using an image map. Is it possible to move the image map if I move the DIV containing the links? I would like to slide the links DIV to different locations in the document depending on what link is clicked - can the image map move with it and still keep the correct values of what to click?
Tim