From the documentation
.mouseover() : source
Bind an event handler to the JavaScript mouseover event, or call this event on an element.
.hover() : source
Bind one or two handlers to matched elements, which will be executed when the mouse enters and leaves the elements.
Calling $(selector).hover(handlerIn, handlerOut) is a shorthand for: $(selector).mouseenter(handlerIn).mouseleave(handlerOut);
.mouseenter() : source
Bind an event handler that should be launched when the mouse enters an element, or run this event handler on an element.
mouseover fires when the pointer also moves to the child, and mouseenter only fires when the pointer moves to the associated element.
What does this mean
Because of this, .mouseover() does not match .hover() , for the same reason .mouseover() does not match .mouseenter() .
$('selector').mouseover(over_function) // may fire multiple times // enter and exit functions only called once per element per entry and exit $('selector').hover(enter_function, exit_function)
Navin Rauniyar Jul 11 '13 at 9:15 2013-07-11 09:15
source share