Last active
August 29, 2015 14:01
-
-
Save wilddeer/a73815ca34081828f303 to your computer and use it in GitHub Desktop.
test css prop (with prefixes)
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
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