Reputation: 33966
I'm trying to know when an user clicks on an iframe with external content (a page not owned by me). The reason I need to do it is that my site relies heavily on keyboard navigation and when the iframe is focused I need to tell users to click outside to keep playing.
I'm using a transparent div on on top of the iframe with an onmousedown event. But it's not a great choice since the user needs to click once for the div to disappear and once again to click wherever they want on the iframe.
Are there are other ways to know when the user clicks on the iframe?
Thanks
Upvotes: 1
Views: 1280
Reputation: 8061
The closest I can think of is to listen for blur on your window.
http://www.quirksmode.org/dom/events/blurfocus.html
Upvotes: 1
Reputation: 999
you could find a way around this problem. But personally, I don't think its a good practice to capture events in an IFrame from an External Container.
Upvotes: 0