I have a page where I basically want an element to 'blink' for a certain amount of time and then go back to its initial state. Using jquery UI you can animate the addClass() and removeClass() methods:
$this.addClass('success', 400);
and then
setTimeout(function(){
$this.removeClass('success', 400);
}, 1000);
where the class 'success' has a
background-color: green
The first works. But the removeClass() inside the setTimeout simply removes the class without doing ANY animation. What can this be caused by?
$this? I've tested this and it seems fine. My code is slightly different than yours tho. Fiddle here