This polyfill takes the official CSS filters syntax and translates it to the different equivalent techniques that the browsers know for those effects
This polyfill takes the official CSS filters syntax and translates it to the different equivalent techniques that the browsers know for those effects
This polyfill takes the official CSS Filter Effects syntax, which spec you can find over here and translates it to the different equivalent techniques that the browsers know for those effects:
For instance, this allows you to assign a property like
filter: blur(10px);
in your stylesheets and the polyfill will take care that it works in as many browsers as possible.
Have a look at this overview.
* the IEs only support 0% or 100% values
Currently the polyfill is able to support
and
Also have a look at http://caniuse.com/css-filters
Why is IE 6 - 9 supported, but not IE 10 or higher? Well, since Microsoft decided to switch sides and to now follow standards, they killed their old proprietary filters beginning with IE 10 which I rely on for emulation.
Altough they did introduce SVG filters sadly those are limited to a usage inside SVGs. They cannot be applied to HTML-elements.
Even triggering legacy mode does not help any more. So this is why we are left at the end with no hook/support at all in IE10+ :(
Older Operas with Presto engine are not supported, as they offer none of the hooks I used.
First create a `
This is important both for the old IEs and the web worker script.
Should you not want the document stylesheets to not get automatically parsed, like when your plan is to apply filters only via JavaScript, then you can additionally set a `polyfilter_skip_stylesheets` switch:
```html
Then you link cssParser.js and css-filters-polyfill.js from the polyfill library.
…
css
.element{
filter: blur(10px);
}And you can even assign two filters at once, e.g.
.element{
filter: sepia(1) blur(10px);
}In addition the polyfill also extends the JavaScript CSSStyleDeclaration object, so that you can assign filter styles on the fly as you are used to with CSS. But instead of exposing a element.style.filter property as one would think, you instead need to address element.style.polyfilter, e.g.:
element.style.polyfilter = 'blur(10px)';or via jQuery:
$(element).css('polyfilter','blur(10px)');And, again, you can assign two filters at once, e.g.
element.style.polyfilter = 'sepia(1) blur(10px)';Note: This does not work for IE 6 & 7. They just ignore any programmatic assignment.
Likewise, if you want to animate a filter, then you do this:
var value = 0,
increment = 1
elem = document.getElementById('filtered');
window.setInterval(function(){
value += increment;
elem.style.polyfilter = 'blur(' + value + 'px)';
if(value >= 10 || value
Header set Access-Control-Allow-Origin "*"
Or if you want more security, replace the * with the requesting domain:
Header set Access-Control-Allow-Origin "requestingdomain.com"
See http://schepp.github.io/CSS-Filters-Polyfill/examples/
Copyright (c) 2012 - 2013 Christian Schepp Schaefer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No open issues yet, or sync has not completed.