Skip to content Skip to sidebar Skip to footer

Click Through Transparent Floating Iframe

I have a transparent floating iFrame with a lot of empty area. It floats on top of my site (position:fixed). The problem is that if anyone click on the empty area, it does not cli

Solution 1:

Well, no. The only thing you could do is to simulate it by capturing the click event, get the coordinates, and then try to find the correct element beneath, and execute the onclick event handler. However, it's a bit impractical, and I think that you should expect some bugs..

Are you sure there isn't another way to solve your problem without that transparent iframe?


Solution 2:

Traversing DOM would be necessary, as stated by Onkelborg.

You'd get the mouse position and test every dom element to see whether or not it was clicked. You'd then have to invoke whatever event handler you've defined... You'd have to manually manage event bubbling as well [which is different between IE and other browsers, as far as i know]...

I should also note that it isn't possible to take a picture of your website with JavaScript, so you couldn't click through transparent text either way, nor could you click through images that have transparency.

I think the best option here would be for you to show us an example of what you're trying to do. Usually, a little restructuring of the website can go around this problem.


Post a Comment for "Click Through Transparent Floating Iframe"