Created
March 27, 2014 00:06
-
-
Save niceaji/9796798 to your computer and use it in GitHub Desktop.
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 CssFilterSupport = { | |
checkSupport : function(testCase){ | |
return window.CSS && _.isFunction(CSS.supports) && (CSS.supports("-webkit-filter", testCase) || CSS.supports("filter", testCase)); | |
}, | |
blur : function(){ | |
return this.checkSupport("blur(10px)"); | |
}, | |
brightness : function(){ | |
return this.checkSupport("brightness(1)"); | |
}, | |
contrast : function(){ | |
return this.checkSupport("contrast(1)"); | |
}, | |
dropShadow : function(){ | |
return this.checkSupport("drop-shadow(5px 5px 5px black)"); | |
}, | |
grayscale : function(){ | |
return this.checkSupport("grayscale(1)"); | |
}, | |
hueRotate : function(){ | |
return this.checkSupport("hue-rotate(10deg)"); | |
}, | |
invert : function(){ | |
return this.checkSupport("invert(1)"); | |
}, | |
opacity : function(){ | |
return this.checkSupport("opacity(1)"); | |
}, | |
saturate : function(){ | |
return this.checkSupport("saturate(1)"); | |
}, | |
sepia : function(){ | |
return this.checkSupport("sepia(1)"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment