I want to make a DIV background (which doesn\'t have a background color) flash red then ease out to blank again. now I have used JS to add a new CLASS (which adds the red) to t
One way to do it is to use the jQuery UI animate method, which extends the "normal" jQuery animate() to affect things like background-color.
Transitions like this is possible in css3 to, but obviously with not as wide browser support.
#maDiv {
-webkit-transition:background-color 0.5s linear;
-moz-transition: background-color 0.5s linear;
-o-transition: background-color 0.5s linear;
height: 20px;
width: 20px;
background:#000;
}
#maDiv:hover {
background: #ff0;
}
That will fade the color when the user hovers the Div, and fade it back when mouse is out, over 0.5 seconds. For browser support details, see "css3 transition" here: http://www.html5rocks.com/en/features/presentation