开发者

Flash under layer, clicks

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!


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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜