我正试图开发一个过山车应用程序,并且在接收mouseLeave事件时遇到了问题。
Overwolf应用程序:
<div id="menu" onMouseDown="dragMove();">
<div id="close" onclick="closeWindow();"></div>
</div>
<iframe src="URL_to_Webpage"></iframe>
<div id="scale" onmousedown="dragResize('BottomLeft');"></div>
<div id="sliderBg">
<div id="slider"></div>
</div>菜单、“关闭”、“缩放”和“滑块”元素被覆盖(“位置:绝对;左:.”)作为窗口控制元素(缩放、关闭、.)
网页(iframe内容):
$('html').hover(function() {
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
});我总是像预期的那样将悬浮类应用到我的iframe中。CSS :悬停选择器也会被应用。
不过,mouseLeave事件只是在离开iframe而不“触摸”覆盖的窗口控件元素时触发的。因此,如果我在用鼠标离开时触摸到这些元素,“悬停”类就不会被移除(事件根本不会触发),所有应用于css的“:悬浮”选择器也不会被移除。
如能提供任何帮助,将不胜感激。
发布于 2015-03-27 13:23:16
尝试在iframe上添加'id‘名称,而不是直接使用html。我想看看它是如何运作的,充分描绘你想要做的事情。请您将您的代码粘贴到http://jsbin.com并让我知道链接好吗?
https://stackoverflow.com/questions/29301424
复制相似问题