How do you fade in/out a background color using jquery?

mrblah picture mrblah · Jun 9, 2009 · Viewed 157.7k times · Source

How do I fade in text content with jQuery?

The point is to draw the user's attention to the message.

Answer

user113716 picture user113716 · Jun 9, 2009

If you want to specifically animate the background color of an element, I believe you need to include jQueryUI framework. Then you can do:

$('#myElement').animate({backgroundColor: '#FF0000'}, 'slow');

jQueryUI has some built-in effects that may be useful to you as well.

http://jqueryui.com/demos/effect/