Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How do I fade in text content with jQuery?

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

like image 610
mrblah Avatar asked Jun 09 '09 01:06

mrblah


People also ask

How do you fadeOut in jQuery?

The jQuery fadeToggle() method toggles between the fadeIn() and fadeOut() methods. If the elements are faded out, fadeToggle() will fade them in. If the elements are faded in, fadeToggle() will fade them out.

Which are the jQuery fading methods?

jQuery example: fadeIn(), fadeOut(), and fadeToggle() This is an example using jQuery's fadeIn() , fadeOut() , and fadeToggle() methods to change the visibility of elements on the page with a fading effect.

What is fadeIn jQuery?

jQuery fadeIn() Method The fadeIn() method gradually changes the opacity, for selected elements, from hidden to visible (fading effect).

Can you animate background color in jQuery?

The background color animate can be performed with the help of the animate() function or css() function. The background color animate is used to set the background color of the selected elements.


1 Answers

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/

like image 114
user113716 Avatar answered Jan 04 '23 18:01

user113716