Skip to content

Instantly share code, notes, and snippets.

@goliatone
Created March 11, 2014 16:02
Show Gist options
  • Save goliatone/9488866 to your computer and use it in GitHub Desktop.
Save goliatone/9488866 to your computer and use it in GitHub Desktop.
cross browser transition events
var _getTransitionEvent = function(){
if(this._transition) return this._transition;
var transitions = {
'transition':'transitionend',
'OTransition':'oTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
};
return _transition = (function(){
var t,
el = document.createElement('dummy')
for(t in transitions){
if(el.style[t] !== undefined) return transitions[t];
}
})();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment