$( 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" );
}
);
$(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.
$( selector ).on( "Mouse pointer in and out of box", handlerInOut );
Please disable your ad blocker and refresh the window to use this website.