Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mouseenter/mouseleave events not firing for SVG elements using jQuery.on

Have a look at this jsFiddle

The mouseenter/mouseleave don't appear to be firing correctly when using jQuery in conjuction with SVG (Raphael 2.0). I know out of the box SVG jQuery isn't 100% compatible with SVG, however, as far as I can see it only seems to effect IE9.

The weird thing is if you rapidly move your mouse on/off the svg element (making sure you come right off the HTML pane in doing so) and back onto it the events do fire (but not everytime). Just to make sure it wasn't a general problem with on I hooked up the click event which works fine, everytime.

Just wondering if anyone knows if this is a bug or even a known issue?

like image 754
James Avatar asked Jul 11 '12 15:07

James


People also ask

How to trigger mouseout event in jQuery?

jQuery mouseout() MethodThe mouseout() method triggers the mouseout event, or attaches a function to run when a mouseout event occurs. Note: Unlike the mouseleave event, the mouseout event is triggered if a mouse pointer leaves any child elements as well as the selected element.

How do you trigger a Mouseenter event?

The mouseenter() method triggers the mouseenter event, or attaches a function to run when a mouseenter event occurs.. Note: Unlike the mouseover event, the mouseenter event only triggers when the mouse pointer enters the selected element.

What is the difference between mouseout and mouseleave?

This means that mouseleave is fired when the pointer has exited the element and all of its descendants, whereas mouseout is fired when the pointer leaves the element or leaves one of the element's descendants (even if the pointer is still within the element).

What is mouseout event in jQuery?

The mouseout event is sent to an element when the mouse pointer leaves the element. Any HTML element can receive this event.


1 Answers

This is a bug in 1.7.2. See ticket.

Problem goes away if I use jQuery (edge) so should be fixed in the next scheduled release (1.8).

like image 70
James Avatar answered Sep 30 '22 11:09

James