You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
In v1.2.0 and earlier, $.fn.animationComplete(callback) leaks the supplied callback.
When $.support.cssTransitions is true in $.fn.animationComplete(), the function attaches the callback to both the webkitAnimationEnd and the animationend events.
However, only one of these will fire depending on the browser. For example, on WebkKit, the webkitAnimationEnd will fire but the callback will be retained on behalf of the animationend event which never fires. This leads to memory leaks.
The fix is to attach to a browser-specific event:
//animation complete callback
var animationEndEvent = "WebKitTransitionEvent" in window ? "webkitAnimationEnd" : "animationend";
$.fn.animationComplete = function(callback) {
if ($.support.cssTransitions) {
return $(this).one(animationEndEvent, callback);
} else {
// defer execution for consistency between webkit/non webkit
setTimeout(callback, 0);
return $(this);
}
};
The text was updated successfully, but these errors were encountered:
nonplus
pushed a commit
to nonplus/jquery-mobile
that referenced
this issue
Oct 11, 2013
In v1.2.0 and earlier,
$.fn.animationComplete(callback)
leaks the suppliedcallback
.When
$.support.cssTransitions
istrue
in$.fn.animationComplete()
, the function attaches the callback to both thewebkitAnimationEnd
and theanimationend
events.However, only one of these will fire depending on the browser. For example, on WebkKit, the
webkitAnimationEnd
will fire but the callback will be retained on behalf of theanimationend
event which never fires. This leads to memory leaks.The fix is to attach to a browser-specific event:
The text was updated successfully, but these errors were encountered: