Color Animation with jQuery UI

jQuery UI extends animation support so supported CSS color properties can transition between colors. Load jQuery first, then jQuery UI.

Load jQuery UI Top ↑

You can download jQuery UI from jqueryui.com, or use a versioned CDN file.

<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.14.2/jquery-ui.min.js"></script>

Animate a Background Color Top ↑

$("#panel").animate({
    backgroundColor: "#fff3cd"
}, 600);

Demo: animate background color →

Color Properties in the Original Tutorial Set Top ↑

The browser must support the underlying CSS property. jQuery UI supplies the color interpolation used by these examples.

PropertyUse
backgroundColorBackground color
borderBottomColorBottom border color
borderLeftColorLeft border color
borderRightColorRight border color
borderTopColorTop border color
colorText color
columnRuleColorColumn rule color when the CSS property is supported
outlineColorOutline color
textDecorationColorText-decoration color when supported
textEmphasisColorText-emphasis color when supported
Correction: the older page listed extEmphasisColor; the CSS property name is textEmphasisColor.

← Previous: animate() · jQuery Effects






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