【发布时间】:2016-05-26 01:47:31
【问题描述】:
看看下面的 CodePen 演示:http://codepen.io/anon/pen/vLPGpZ
这是我的代码:
body {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: url(http://lorempixel.com/900/300) no-repeat center center fixed;
}
body:before {
left: 0;
right: 0;
content: "";
position: fixed;
height: 100%;
width: 30%;
background: url(http://lorempixel.com/900/300) no-repeat center center fixed;
filter: sepia(1);
}
您将看到应用了棕褐色过滤器。我想要的是在同一张图片上并排应用三个 CSS 过滤器。前 1/3 部分使用灰度滤镜,中间 1/3 部分使用棕褐色滤镜,最后 1/3 部分使用对比度滤镜。如何使用 jQuery 或 JavaScript 来实现这一点?
现在,即使是三分之一的部分也没有被 Sepia 正确覆盖。
【问题讨论】:
标签: javascript jquery html css