将iframe上的mousemove事件冒泡到容器div

时间:2015-09-10 11:52:10

标签: javascript jquery html iframe

我有以下代码

<div onmousemove="myFunction()">
  <iframe src="www.someotherdomain.com"/>
</div>

当用户将鼠标移到iframe上时,我希望执行myFunction。是否有可能将iframe上的事件冒泡到跨域方案中的父元素?我该怎么做?

PS: - 我无法使用

中提供的解决方案

Iframe obstructing the mousemove event from occuring

How do you send a mousemove event from an iframe back to the parent using jquery?

因为我希望用户能够与iframe中的内容进行互动。

0 个答案:

没有答案