SVG onmouseover for group with overlapping elements occurs twice

后端 未结 2 821
抹茶落季
抹茶落季 2021-01-06 12:30

When attaching a function to the onmouseover event for an SVG group ..., the event occurs once, each time the pointer enters to

2条回答
  •  猫巷女王i
    2021-01-06 13:00

    Sounds familiar, I think the bubbling will bite you in such cases.

    Some examples from one of my SVG Open presentations in 2008, in particular slide 17 should be of interest. It might be that having something like 'mouseenter'/'mouseleave' events would solve this, but they're not yet in a w3c recommendation.

    Edit: To be clear mouseenter and mouseleave are in the DOM Level 3 Events working draft.

提交回复
热议问题