Skip to content

Commit e4c4463

Browse files
committed
Ensure animate callback always triggered
1 parent 9b77aca commit e4c4463

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/fx.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,24 @@
7676
}
7777
}
7878

79+
var fired = false
7980
wrappedCallback = function(event){
8081
if (typeof event !== 'undefined') {
8182
if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below"
8283
$(event.target).unbind(endEvent, wrappedCallback)
8384
}
85+
fired = true
8486
$(this).css(cssReset)
8587
callback && callback.call(this)
8688
}
87-
if (duration > 0) this.bind(endEvent, wrappedCallback)
89+
if (duration > 0){
90+
this.bind(endEvent, wrappedCallback)
91+
//transitionEnd not always fired on some android phones
92+
setTimeout(function(){
93+
if(fired) return
94+
that.each(function(){ wrappedCallback.call(this) })
95+
}, duration * 1000)
96+
}
8897

8998
// trigger page reflow so new elements can animate
9099
this.size() && this.get(0).clientLeft

0 commit comments

Comments
 (0)