问题描述
我的问题是一个非常简单的问题:
My question is a pretty simple one:
如果我使用标准HTML编码显示图像,是否可以完全使用jQuery单独去饱和该图像?
If I code an image to display using standard HTML, is it possible to desaturate that image completely using on jQuery alone?
这个想法是当用户将鼠标悬停在图片上时,返回正常饱和状态。
The idea would be to return to normal saturation once the user hovers over the image...
知道有一个使用HTML5 Canvas的实验方法,但是暂时我不想使用HTML5:)
I know there's an experimental method using HTML5 Canvas , but for the time being I'd like to stay away from HTML5 :)
谢谢忍者的,一如既往的谦虚的经验从你那里学习,
The Tiny Giant
Thank you Ninja's, as always it's a humbling experience learning from you,The Tiny Giant
推荐答案
单独使用jQuery?不是真的。你需要一些方法来处理图像数据,并且只有四种方法我知道:
Using jQuery alone? Not really. You need some method to manipulate the image data and there are only four methods I'm aware of:
- HTML5 Canvas
- 通过CSS应用的SVG过滤器(目前Firefox - 仅根据我的测试)
- Flash Applet(过度,重,通常不愉快。)
Matt Gibson的建议是一个很好的,如果你唯一的关注是兼容性,或者你可以自己使用一些混合的上述方法。
Matt Gibson's suggestion of Pixastic is a good one if your only concern is compatibility or you could roll your own using some mixture of the aforementioned approaches.
这篇关于颜色饱和/去饱和在jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!