Is it possible to animate the background-color
in jQuery, because it is not working.
$(\'#something\').animate({
background :\"red\"
}, 1000
From the docs,
The jQuery UI project extends the
.animate()
method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.
So if you use jQuery UI, you can animate background colors. Just make sure that you use backgroundColor
and not background
.
The color animations plugin for jQuery also does it.
Live Example: http://jsfiddle.net/thai/NXejr/2/