.hover()


Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.

.hover( handlerIn, handlerOut )Возвращает: jQuery

Описание: Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.

The .hover() method binds handlers for both mouseenter and mouseleave events. You can use it to simply apply behavior to an element during the time the mouse is within the element.

Calling $( selector ).hover( handlerIn, handlerOut ) is shorthand for:

1
$( selector ).mouseenter( handlerIn ).mouseleave( handlerOut );

See the discussions for .mouseenter() and .mouseleave() for more details.

Примеры использования

.hover( handlerInOut )Возвращает: jQuery

Описание: Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.

The .hover() method, when passed a single function, will execute that handler for both mouseenter and mouseleave events. This allows the user to use jQuery's various toggle methods within the handler or to respond differently within the handler depending on the event.type.

Calling $(selector).hover(handlerInOut) is shorthand for:

1
$( selector ).on( "mouseenter mouseleave", handlerInOut );

See the discussions for .mouseenter() and .mouseleave() for more details.

Примеры использования