Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save desandro/446026 to your computer and use it in GitHub Desktop.
Save desandro/446026 to your computer and use it in GitHub Desktop.
// jQuery.support.css3
// verifies css3 properties across browsers
// i.e. $.support.css3('transition')
$.support.css3 = function(prop) {
var
support = false,
thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
props = [
prop,
'Webkit' + uc_prop,
'Moz' + uc_prop,
'O' + uc_prop,
'ms' + uc_prop,
'Khtml' + uc_prop
]
;
for ( var i in props ) {
if ( thisStyle[ props[i] ] !== undefined ) {
support = true;
break;
}
}
return support;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment