Make a grayscale image with css in IE11 running in Quirks mode

旧城冷巷雨未停 提交于 2019-11-28 04:51:35

问题


I need to convert some colorful images on an internal legacy web application to grayscale. I figured the easiest way would be to use CSS filters. The users of this application access it via IE11 due to a Group Policy. This application must also be run using Quirks (IE5) document mode, otherwise crazy things happen (rendering issues, javascript not working, etc).

I have tried the following code (as well as code from here, here, and here)

img.desaturate {
    -webkit-filter: grayscale(100%);
    filter: gray;
    filter: grayscale(100%);
    filter: url(desaturate.svg#greyscale);
}

with no effect. Given this criteria (IE11 running with IE5 Document mode), is there anything I can do to get these grayscale images, and if so, how?

note: redesigning the application to work with more modern technologies is not currently funded, and will not be in the future.

note: converting each image to grayscale with some script and saving the output is also not an option, as there are millions of images available.

Link to example that shows colorful Google logo: https://jsfiddle.net/bq2mw5ya/2/


回答1:


actually i turn my comment as an answer for feed back:

IE specific filter should stand last, so it is not overide by a next one.

Activex should also allowed to run

and of course, it should be in quirk mode ...

img.desaturate {
    -webkit-filter: grayscale(100%);
    filter: grayscale(100%);
    filter: url(desaturate.svg#greyscale);
    filter: gray;
}


来源:https://stackoverflow.com/questions/35711940/make-a-grayscale-image-with-css-in-ie11-running-in-quirks-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!