Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

21
  • 5
    Doesn't work for me either - are you sure this isn't relying on the color animations plugin? plugins.jquery.com/project/color
    – UpTheCreek
    Commented Dec 18, 2010 at 14:58
  • 18
    From jquery docs on .animate() : All animated properties should be a single numeric value (except as noted below); properties that are non-numeric cannot be animated using basic jQuery functionality. (For example, width, height, or left can be animated but background-color cannot be.) So I guess you are utilising a plugin without realising it.
    – UpTheCreek
    Commented Dec 18, 2010 at 15:17
  • 4
    I noticed it didnt return an object. I tried stacking this little effect (EG: $("#qtyonhand").animateHighlight("#c3d69b", 1500).delay(1500).animateHighlight("#76923C", 5000); ) and got an error. I needed to add "return this;" to the end of the method.
    – Sage
    Commented May 14, 2011 at 12:13
  • 2
    Official jQuery Docs say you must use the jQuery.Color() plugin for this to work: github.com/jquery/jquery-color
    – jchook
    Commented Dec 12, 2012 at 4:58
  • 4
    From the jquery .animate docs: Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. - If you want to animate colour, you NEED jQuery UI or some other plugin.
    – Adam Tomat
    Commented Apr 9, 2013 at 7:53