Skip to content

Instantly share code, notes, and snippets.

@msrafi
Forked from desandro/jQuery.support.css3.js
Created March 19, 2014 20:32
Show Gist options
  • Select an option

  • Save msrafi/9650558 to your computer and use it in GitHub Desktop.

Select an option

Save msrafi/9650558 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