Possible duplicate:
How to loop a css background image using jquery every few seconds?
I am wondering how to achieve a simple effect of "animating" colors that change every second, and if there is a way to animate the animation, it might be even better.
I just tried something like:
$('.box').delay(1000).css("background","red");
And it does not work at all (the delay function does not work). In any case, I need as two of them:
$('.box').delay(1000).css("background","red");
$('.box').delay(1000).css("background","green");
So that it turns red → wait a second and turns green → turns red again.
Is it possible? thank!
source
share