visionmedia / move.js

CSS3 backed JavaScript animation framework
http://visionmedia.github.com/move.js/
4.72k stars 685 forks source link

Replace setTimeout for the native transitionend event to emit the 'end' event #22

Closed becojo closed 11 years ago

becojo commented 11 years ago

Using setTimeout can sometime trigger the end event when the transition is still on going (e.g., the browser paused the transition because the window didn't had focus). Using the transitionend event fixes this problem.

The browser compatibility of transitionend event

yields commented 11 years ago

sorry for the late response man,

the source has moved to index.js, so you should change stuff there and then run $ make.

It will be great to use something like anthonyshort/after-transition instead of addEventListener.

after-transition will invoke the callback immediately if the browser doesn't support them, otherwise the callback will be invoked after transitionend

i'm going to do this in the coming days anyway :D