层下闪烁,点击

发布于 2024-11-09 06:49:26 字数 241 浏览 0 评论 0原文

我需要捕获 Flash 对象顶部的悬停事件,因此我设置了 wmode 并在其顶部创建了一个不可见的 div 以附加事件侦听器。

问题是,我无法单击 Flash 对象。封面正在吞噬点击声,而我试图解决这个问题的事情却使悬停事件变得一团糟。

对于这种情况是否有既定的解决方案或可以提供帮助的想法?这是我在 2 天内遇到的第 30 个问题,它快把我逼疯了 xD。

提前致谢!

I need to catch a hover event on top of a flash object, so I set the wmode and created an invisible div on top of it to attach the event listeners to.

Thing is, I can't click the flash object. The cover is swallowing the clicks, and the things I've tried to go around this have made a mess of the hover events.

Is there an established solution to this kind of scenario, or ideas that could help? This is the 30th problem I ran into in 2 days time and it's driving me crazy xD.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寄人书 2024-11-16 06:49:26

解决了。我刚刚取下盖子,将监听器连接到另一个不显眼的容器中,其中包含更多的 div,然后是 flash 对象。

该封面是解决另一个问题时剩下的,不再需要了。不管怎样,谢谢你们!

Solved. I just removed the cover and attached the listeners to another, unobstrusive container, holding some more divs and then the flash object.

The cover was a leftover from a solution to another problem, and was no longer needed. Thanks anyway, guys!

瑾夏年华 2024-11-16 06:49:26

我知道您很久以前就解决了您的解决方案,但从它的声音来看,您也可以使用代码 pointer-events: none; 来解决您的问题。这将使咔哒声直接穿过盖子。

请参阅文档

指针事件:无;

该元素永远不是鼠标事件的目标;但是,如果后代将指针事件设置为某个其他值,则鼠标事件可能会以其后代元素为目标。在这些情况下,鼠标事件将在事件捕获/冒泡阶段期间在往返子元素的途中酌情触发此父元素上的事件侦听器。

I know you solved your solution a long time ago but by the sounds of it, you could have also used the code pointer-events: none; to solve your problem. This would have allowed the clicks to pass straight through the cover.

See the docs

pointer-events: none;

The element is never the target of mouse events; however, mouse events may target its descendant elements if those descendants have pointer-events set to some other value. In these circumstances, mouse events will trigger event listeners on this parent element as appropriate on their way to/from the descendant during the event capture/bubble phases.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文