Search code examples
eventsraphaelevent-bubbling

Raphael - How prevent the bubbling event on a set


myset = paper.set();
myset.push(mycircle);
myset.push(mytext);
myset.mouseover(function(){ ... });

If I go upon item, or better on the text, the event takes it off. What can I do to prevent that?

After some modify, now it works...


Solution

  • Set the CSS property pointer-events to none on the text element. E.g.

    mytext.node.setAttribute("pointer-events", "none");
    

    You need to do it via the node as this is not something directly supported by Rapahel so it will be ignored if you set it via mytext.attr directly.