Skip to main content

Tedshd's Dev note

Category: Css3

JavaScript - detect CSS3 transitionEnd

# JavaScript - Detect CSS3 transitionEnd transitionend It is a event can fired when CSS3 transition end. function transitionEnd() { var el = document.createElement('div'), //what the hack is bootstrap transEndEventNames = { WebkitTransition : 'webkitTransitionEnd', MozTransition : 'transitionend', OTransition : 'oTransitionEnd otransitionend', transition : 'transitionend' }; for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return transEndEventNames[name]; } } return false; // explicit for ie8 ( ._.) } // Usage document. ...