Why am I seeing “hover” “mouseenter/mouseleave” and “mouseover”?
Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters andleaves the elements.
$(selector).hover(handlerIn, handlerOut) is shorthand for:
Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
mouseover fires when the pointer moves into the child element as well, while
mouseenter fires only when the pointer moves into the bound element.
What this means
Because of this,
.mouseover() is not the same as
.hover(), for the same reason
.mouseover() isnot the same as
$('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)
2. Why am I seeing “hover” “mouseenter/mouseleave” and “mouseover”?
“In OO [object oriented] world, the two are commonly used to mean the same thing.
From a pure Math and CS perspective, a function will always return the same result when called with the same arguments ( f(x,y) = (x + y) ). A method on the other hand, is typically associated with an instance of a class. Again though, most modern OO languages no longer use the term “function” for the most part. Many static methods can be quite like functions, as they typically have no state (not always true).”