> how can i modifiy this statement
> that the mouseover fire's only on time ?
Put a rect element below your other stuff, and have it handle the
mouseover event:
<svg:g id="ico">
<svg:rect class="mousetarget"></svg:rect>
...
</svg:g>
d3.selectAll(".mousetarget").on("mouseover", function() {
console.log("mouseover"); });
Cheers,
-Nate
1. You could listen to a specific element rather than its group.
Nate's suggestion of a rect is one example, but your circle is another
example.
2. You can add an invisible element with pointer-events: all that
serves as an event target.
3. You can disable pointer events on other elements by using
pointer-events: none.
4. You can filter mouseover and mouseout events by looking at
d3.event.target. If you only handle events where this ==
d3.event.target, it will be equivalent to mouseenter and mouseexit.
Mike