I'm using animate.css
to put some nice effects to my backbone views.
One of the animations that I'm using is the flipOutX
when a list item is deleted.
Here is my drop function:
drop: function() {
var that = this;
this.$el.addClass('animated flipOutX');
setTimeout(function() {
that.remove();
}, 1000);
}
Knowing that using setTimeout
is a really bad idea, do you have any work around to apply this effect?
I'm using the setTimeout
to be sure the addClass
effect is completed before effectively removing the view. Here my problem is the fact that addClass
is not asynchronous.