Questions tagged [jquery-hover]

The .hover() method binds handlers for both mouseenter and mouseleave events.

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.

$(selector).hover( handlerIn, handlerOut )

Note that Calling above code is shorthand for:

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

Example:

// hover
$("li").hover(function() {
  $(this).append("<span>***</span>");
// unhover
}, function() {
  $(this).find("span:last").remove();
});

Reference: http://api.jquery.com/hover/

618 questions
29
votes
4 answers

How to: Add/Remove Class on mouseOver/mouseOut - JQuery .hover?

Looking to change the border color on a box.. ..when the user mouses over/out.. Here's the attempted code.. Needs Work! JQuery: