.hover( handlerIn, handlerOut )
The method hover() is a shorthand of :
Syntax:$( selector ).mouseenter( handlerIn ).mouseleave( handlerOut );
$( selector ).hover( handlerIn, handlerOut )Example:
$( "p" ).hover(
function() { // Mouse enters the
$( this ).addClass( "hover" );
}, function() { // Mouse exits zone
$( this ).removeClass( "hover" );
}
);
.hover( handlerInOut )
This method is useful when the same processing is repeated for both the input and output events of the target element area. We won't need to copy the code into both the input and output event functions.Syntax:
$(selector).hover(handlerInOut)When passing a single function to the hover(), it will execute two events, mouseenter and mouseleave. This allows the jQuery user to use the different failover methods in the handler or respond differently depending on event.type.
Example:
$( selector ).on( "Mouse pointer in and out of box", handlerInOut );
References:
https://api.jquery.com/hover/
Commentaires (12)
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Excellent tutoriel ! J'ai enfin compris comment utiliser Apache POI correctement.
Merci Jean ! N'hésitez pas si vous avez des questions.