I have a script that removes an element when a css3 animation triggers AnimationEnd in jQuery. The problem is that these animations are bound to an external css file that may not be included.
Right now I call this.
$element.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(event) {
$(this).remove();
});
But if the element does not have the animation because either the browser didn't support it or the animation file was not included I still need to remove the element. How can I check if this was called.
I have tried this, but it doesn't seem to change the value to true.
var hasAnimation = false;
$element.one('webkitAnimationStart oanimationstart msAnimationStart animationstart', function(event) {
hasAnimation = true;
});
if (!hasAnimation) {
$element.remove();
}
setTimeoutbut hey, gotta do what you gotta do.