Scroll parent window when iframe hovered

Scroll parent window when iframe hovered



Context



I'm trying to embed an iframe within another page (different domains)

The embed code looks like this:


<script type="application/javascript" src="[...]/myTopScript.js"></script>
<iframe src="differentDomain/somePage.html" frameborder="0" allowfullscreen width="100%"></iframe>



I'm responsible for iframe content and myTopScript.js

There is another script within the iframe (lets call it myInnerScript.js)



TL;DR: iframe height is always superior to its content height (no scroll inside)



Whenever my iframe content height change I'm sending a message to the parent window (via window.parent.postMessage) to provide the new height to myTopScript.js. The top script will then catch the message and update my iframe height property to newHeight + 1px.


window.parent.postMessage


newHeight + 1px



This way my iframe never needs a scrollbar and looks like any other part of the host website.



Issue



I can't scroll the parent page (with the mouse wheel) when the mouse is over the iframe.


overflow:hidden


<body>


scrolling="no"


pointer-events:none


<iframe>



Do you have any spec reference or document explaining this ? And ideas on what else I could try ?



I thought about forwarding mousewheel events via postMessage but I'm pretty sure this would not be reliable




0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)