Created
May 2, 2012 08:33
-
-
Save NeilJS/2575101 to your computer and use it in GitHub Desktop.
Cross-browser CSS3 transitionend event for event listeners
This file contains 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
// CROSS-BROWSER TRANSITION END EVENT LISTENERS | |
var transEndEventNames = { | |
'WebkitTransition' : 'webkitTransitionEnd', | |
'MozTransition' : 'transitionend', | |
'OTransition' : 'oTransitionEnd', | |
'msTransition' : 'MSTransitionEnd', | |
'transition' : 'transitionend' | |
}, | |
transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; // bind event listener to transEndEventName eg: this.addEventListener(transEndEventName, callbackFunction, false); | |
//alert(transEndEventName); | |
Source: http://modernizr.com/docs/ ... Modernizr.prefixed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment