在以Quirks模式运行的IE11中使用CSS制作灰度图像 [英] Make a grayscale image with css in IE11 running in Quirks mode

查看:204
本文介绍了在以Quirks模式运行的IE11中使用CSS制作灰度图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将内部旧版Web应用程序上的一些彩色图像转换为灰度图像.我认为最简单的方法是使用CSS过滤器.该应用程序的用户由于组策略而通过IE11对其进行了访问.此应用程序还必须使用Quirks(IE5)文档模式运行,否则会发生疯狂的事情(渲染问题,javascript无法正常工作等).

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);
}

无效.在此条件下(以IE5文档模式运行IE11),我可以做些什么来获取这些灰度图像,如果可以,怎么办?

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?

注意:重新设计应用程序以使用更多现代技术目前尚无资金支持,并且将来也不会.

注意:因为有数以百万计的可用图像,所以也不可以使用某些脚本将每个图像转换为灰度并保存输出.

链接到显示彩色Google徽标的示例: https://jsfiddle.net/bq2mw5ya/2/

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

推荐答案

实际上,我将我的评论作为反馈的答案:

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

特定于IE的过滤器应排在最后,因此不会被下一个覆盖.

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

还应允许Activex运行

当然应该处于怪癖模式下...

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;
}

这篇关于在以Quirks模式运行的IE11中使用CSS制作灰度图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆