I have a common task: open a layer somewhere in the page and close it, when the user clicks anywhere in the rest of the page. This works fine with a click event handler on the document, unless of course there is an iframe on the page.

Therefore, I add a blur event handler on the window, because when I click in the iframe, the iframe gets focused and the outer page gets blured. Since it's ok to close the layer on blur (even if it is not done by focussing the iframe), I have a working solution.

Except for in Opera. In Opera, when I click within the iframe, a focus (!) event happens on the document of the outer page. Yes, a focus event. See for yourself: http://jsfiddle.net/twZ5R/1/

Is this a bug in Opera? Is it a feature?
And for my original task: Is there a better way to detect a click in an iframe than to listen for a blur on the window?

Matt

--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to