jQuery Hover Event

The jQuery .hover() helper accepts a function for pointer entry and another for pointer exit. For more explicit event handling, you can also use .on("mouseenter mouseleave", ...).

Hover Syntax Top ↑

$( "element" ).hover(
    function () {
        // Pointer entered.
    },
    function () {
        // Pointer left.
    }
);

Apply Hover to Multiple Elements Top ↑

$( "#d1, #d2" ).hover(
    function () {
        $( this ).fadeTo( "fast", 0.3 );
    },
    function () {
        $( this ).fadeTo( "fast", 1.0 );
    }
);

Open the hover demo →

For direct entry/exit control, continue with mouseenter and mouseleave. The fade behavior itself is covered in fadeTo().

Mouse Events with jQuery






plus2net.com






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer