filter:IE 11中的灰度(100%)用于图像

问题描述 投票:-1回答:2

我在互联网上搜索过,但我没有得到任何解决方案。

任何人都可以说在IE 11和IE 12中css3 filtertransistion3d的替代方案是什么?

我不想使用任何插件。

不适用于SVG我想要<img>标签

css3 internet-explorer-11 internet-explorer-10
2个回答
1
投票

因为IE11不支持过滤器 - 有像this那样的黑客但是它必须包含很多JS看到的here,这意味着在JS中编写浏览器检测等等。 -


1
投票

您可以尝试添加两种图像,一种是原始图像,另一种是灰度图像。然后,使用div显示这些图像。像这样:

<style>
    .grayscale {
        background-image: url('images/Image1.jpg');
        background-size: cover; /* <------ */
        background-repeat: no-repeat;
        background-position: center center;
    }

        .grayscale:hover {
            background-image: url('images/imag1_gray.PNG') ;
            background-size: cover; /* <------ */
            background-repeat: no-repeat;
            background-position: center center;
        }
</style>
<div class="grayscale" style="width:500px; height:500px">
</div>

结果是这样的:

enter image description here

在我的选择中,我更喜欢使用一些JQuery插件,如this

© www.soinside.com 2019 - 2024. All rights reserved.