back to Overview

.onOver()

Registers a function to be called whenever the mouse pointer enters or leaves one of the list's elements.
Web module only.

Syntax Variants

list.onOver(handler)
list.onOver(selector, handler)
list.onOver(handler, bubbleSelector)

Parameters

selector (optional)
a selector string for $() to register the event only on those children of the list elements that match the selector. Supports all valid parameters for $() except functions.
toggle
the callback function(isOver, event) to invoke when the event has been triggered:
isOver
true if mouse is entering any element, false when leaving.
event
The original event object given to on().
this
A Minified list containing the target element that caused the event as only item.
(return value)
the list

Description

Registers a function to be called whenever the mouse pointer enters or leaves one of the list's elements. The handler is called with a boolean parameter, true for entering and false for leaving, which allows you to use any toggle() function as handler.

Example

Creates a toggle that animates the element on mouse over:

$('#mouseSensitive').onOver($('#mouseSensitive').toggle({$color:'#000'}, {$color:'#f00'}, 500));

See also..

  • on() provides low-level event registration.

Comments

comments powered by Disqus

back to Overview

Functions