Created
August 28, 2012 17:30
-
-
Save secretrobotron/3501165 to your computer and use it in GitHub Desktop.
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
} | |
return fragment; | |
}, | |
transitionEndWrapper: (function() { | |
var div = document.createElement( "div" ), | |
p, | |
pre = [ "ms", "O", "Webkit", "Moz", "" ]; | |
// Check for CSS3 Transition support | |
/*jshint loopfunc:true */ | |
for ( p in pre ) { | |
if ( div.style[ pre[ p ] + "Transition" ] !== undefined ) { | |
return function( element, listener ) { | |
element.addEventListener( "transitionend", listener, false ); | |
element.addEventListener( "oTransitionEnd", listener, false ); | |
element.addEventListener( "WebkitTransitionEnd", listener, false ); | |
}; | |
} | |
} | |
/*jshint loopfunc:false */ | |
// Fallback on setTimeout | |
return function( element, listener ) { | |
setTimeout( listener, DEFAULT_TRANSITION_TIMEOUT ); | |
}; | |
}()) | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment