Created
March 11, 2014 16:02
-
-
Save goliatone/9488866 to your computer and use it in GitHub Desktop.
cross browser transition events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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