I'm trying to animate a box's CSS after it has faded in after X seconds (to simulate new, and old) however it doesn't even animate as intended. I also tried .promise().done(function(){ animate({ ... }) })
after the fadeIn()
on the end of the .click()
but that didn't seem to do it either. Is there another way? I've seen it done. :O
JSFiddle
$('#button').click(function() {
var box = $('#box');
box.fadeIn('slow');
var end = setInterval(function() {
box.animate({
backgroundColor: '#EFE9A8',
borderColor: '#F7B64D',
color: '#AD771F'
}, 1200);
clearInterval(end);
}, 200);
});
Update:
It seems my animation doesn't work at all actually.