rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.3k stars 864 forks source link

Proper `transitionEnd` event detection #128

Open rstacruz opened 11 years ago

rstacruz commented 11 years ago

There are many issues related to transitionEnd events (#124, #103 for instance) and the best way to deal with this is to rewrite transitionEnd detection.

The way Transit works now is that it assumes the same prefix for the transitionEnd event as what prefix is used in the transition style. That is, if it found WebkitTransition to be the correct style name, then it assumes that webkitTransitionEnd is the associated event name.

Transitionend events need to be handled differently now. They need to be detected in a more accurate way.

rstacruz commented 11 years ago

This is a little trickier than it sounds, though. Feature detection is usually pretty straightforward:

div = document.createElement('div');
var hasFullscreen = 'onwebkitfullscreenchange' in div;

This method does not work for transitionend.

jomiham commented 10 years ago

We are having problems with the setTimeout fallback ending animations prematurely on iPad, but activating useTransitionEnd breaks IE10 support. Why not use pull request #145 or even #103 at least as a temporary solution?

FossPrime commented 10 years ago

Using setTimeout sometimes ends animations prematurely in Chrome for android and Linux too. About once every 4 times in my case.