animate.css.js
animate.css.js copied to clipboard
transitionEnd events firing more than once
Hello
I noticed that in Chrome the transitionEnd events fire more than once though I can clearly you see tried to make it fire once.
complete = function(element) {
return element.one(transitionEnd, function() {
return callback(element);
});
Why does it fire more than once? i have no clue, and find it odd.
I had to make sure the callback only fired once bying add this to the callback
callback = function(element) {
if (settings.infinite === false) {
element.callOnce=true;
if (element.callOnce) {
element.callOnce=false;
element.off(transitionEnd);
}
removeClass(element);
}
if (typeof settings.callback === 'function') {
return settings.callback.call(element);
}
};
Hope this helps someone, thanks for making and publishing this script!