Created
December 10, 2011 09:29
-
-
Save unlight/1454874 to your computer and use it in GitHub Desktop.
Check for css support
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
| // Detect CSS3 Support | |
| // http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-detect-css-support-in-browsers-with-javascript/ | |
| var IsSupportCssProperty = (function() { | |
| var Dummy = document.createElement('dummy'); | |
| var Vendors = 'Khtml O Ms Webkit Moz '.split(' '); | |
| var Length = Vendors.length; | |
| var Px, CssProperty; | |
| return function(PropertyName) { | |
| for (var Index = Vendors.length - 1; Index >= 0; --Index) { | |
| Px = Vendors[Index]; | |
| CssProperty = PropertyName; | |
| if (Px.length > 0) CssProperty = Px + PropertyName.charAt(0).toUpperCase() + PropertyName.substr(1); | |
| if (CssProperty in Dummy.style) return true; | |
| } | |
| return false; | |
| }; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment