Skip to content

Instantly share code, notes, and snippets.

@wilddeer
Last active August 29, 2015 14:01
Show Gist options
  • Save wilddeer/a73815ca34081828f303 to your computer and use it in GitHub Desktop.
Save wilddeer/a73815ca34081828f303 to your computer and use it in GitHub Desktop.
test css prop (with prefixes)
function testProp(prop) {
var prefixes = ['Webkit', 'Moz', 'O', 'ms'],
block = document.createElement('div');
if (block.style[prop] !== undefined) return true;
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
for (var i in prefixes) {
if (block.style[prefixes[i]+prop] !== undefined) return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment