Skip to content

Commit b1ae271

Browse files
author
Stepan Riha
committed
Navigation: Only bind to browser's AnimationEnd event. Fixes jquery-archive#5156.
1 parent 08efc5b commit b1ae271

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/jquery.mobile.navigation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ define( [
111111
/* exposed $.mobile methods */
112112

113113
//animation complete callback
114+
var animationEndEvent = "WebKitTransitionEvent" in window ? "webkitAnimationEnd" : "animationend";
114115
$.fn.animationComplete = function( callback ) {
115116
if ( $.support.cssTransitions ) {
116-
return $( this ).one( "webkitAnimationEnd animationend", callback );
117-
}
118-
else{
117+
return $( this ).one( animationEndEvent, callback );
118+
} else {
119119
// defer execution for consistency between webkit/non webkit
120120
setTimeout( callback, 0 );
121121
return $( this );

0 commit comments

Comments
 (0)