1.hover ([Over,]out)
A method that mimics the hover event (moving the mouse over an object and moving out of the object). This is a custom method that provides a "keep in" state for frequently used tasks.
The first function that is specified is triggered when the mouse moves over a matching element. When the mouse moves out of this element, the specified second function is triggered. Also, it is accompanied by detection of whether the mouse is still in a particular element (for example, an image in a div), and, if so, continues to remain in a "hover" state without triggering a move-out event (fixed a common error using the Mouseout event).
Parameters:
Over: The mouse moves to the function to be triggered on the element
Out: The mouse moves out of the element to trigger the function
Instance:
$("td").hover( function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); });
2.toggle([speed],[easing],[fn])
Used to bind two or more event handler functions in response to a rotating click event of the selected element.
If the element is visible, toggle to hidden, or toggle to visible if the element is hidden.
Parameters:
Speed: Hides/shows how fast the effect is. The default is "0" milliseconds. Possible values: Slow,normal,fast. "
Easing: (Optional) is used to specify the toggle effect, the default is "Swing", the available parameters "linear"
fn: The function that executes when the animation is complete, once for each element.
Instance:
$("td").toggle( function () { $(this).addClass("selected"); }, function () { $(this).removeClass("selected"); });
jquery Event Switch Hover/toggle