Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Propagating mouse events from iframes to the hosting document

I have an iframe covering the entire HTML document, and I'd like to propagate clicks and hover events back to the hosting document.

What are my options?

like image 389
Eli Avatar asked Oct 24 '22 14:10

Eli


1 Answers

I was asked to look into this several weeks ago for a project. It's possible to do it, and there's a working example of it in action here:

http://www.esqsoft.com/javascript_examples/iframe_talks_to_parent/

However, the crucial thing to bear in mind is that unless the parent and child are on the same domain, it's not possible to have events passed between them. If your iframe contains a page from a different domain then you're out of luck, I think.

like image 180
CVM Avatar answered Oct 27 '22 11:10

CVM