Created
December 13, 2012 14:14
-
-
Save qmmr/4276623 to your computer and use it in GitHub Desktop.
Test for CSS3 support in browser.
This file contains hidden or 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
var supports = (function(prop) { | |
var | |
div = doc.createElement('div') | |
, vendors = 'Khtml Ms O Moz Webkit'.split(' ') | |
; | |
return function (prop) { | |
var len = vendors.length; | |
if (prop in div.style) return true; | |
prop = prop.replace(/^[a-z]/, function(val) { | |
return val.toUpperCase(); | |
}); | |
while (len--) { | |
if (vendors[len] + prop in div.style) { | |
return true; | |
} | |
} | |
return false; | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment