Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow user to 'click through' CSS shadows

Status
Not open for further replies.

lijil

Programmer
Jun 9, 2004
16
CA
Does anyone know of a way to specify that an element should behave as 'click through', that is it does not capture the click, and the user can click whatever is behind that element?

For example if one positions a div with a background image of a semi-transparent shadow over an anchor, the user cannot click the anchor (Ignoring the IE bug in this situation).

I would like the user to be able to click through the shadow since it does not represent a 'solid' object, it is only there for visual effect.
 
It's possible that you might be able to do this with JavaScript, although I have no idea if it would work in practice. It would go something like this:

When the document's onmousedown event fires, grab the X and Y coordinates (dead easy to do this cross-browser, btw). Loop through all anchor elements on the page, checking if the X,Y coordinate is within their bounds. If it is, use JS to "activate" it.

As I said... might not work in all browsers, but then again, it might!

Ask in the JS forum if you fancy giving it a go: forum216.

Hope this helps
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top