Skip to content

Instantly share code, notes, and snippets.

@jorgeguberte
Created November 29, 2012 14:13
Show Gist options
  • Save jorgeguberte/4169357 to your computer and use it in GitHub Desktop.
Save jorgeguberte/4169357 to your computer and use it in GitHub Desktop.
CSS3 Transitions fallback checker (Javascript)
function cssTransitions() {
m = document.createElement('z');
s = m.style;
function test_props( p ) {
for ( var i in p ) {
if ( s[ p[i] ] ) {
return true;
}
}
return false;
}
function test_props_all( prop ) {
d = 'Webkit Moz O ms Khtml'.split(' ');
var u = prop.charAt(0).toUpperCase() + prop.substr(1);
e = (prop + ' ' + d.join(u + ' ') + u).split(' ');
return test_props( e );
}
return test_props_all( 'animationName' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment