Simulates hovering (moving the mouse on, and off, an object). This is a custom method which provides an 'in' to a frequent task.
Whenever the mouse cursor is moved over a matched element, the first specified function is fired. Whenever the mouse moves off of the element, the second specified function fires. Additionally, checks are in place to see if the mouse is still within the specified element itself (for example, an image inside of a div), and if it is, it will continue to 'hover', and not move out (a common error in using a mouseout event handler).
Arguments:
| over | Function | |
|---|---|---|
The function to fire when the mouse is moved over a matched element.
function callback(eventObject) {
this; // dom element
}
| ||
| out | Function | |
The function to fire when the mouse is moved off of a matched element.
function callback(eventObject) {
this; // dom element
}
| ||