开发者

Colour Saturation/Desat in jQuery

My question is a pretty simple one:

If I c开发者_如何转开发ode 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...

I know there's an experimental method using HTML5 Canvas , but for the time being I'd like to stay away from HTML5 :)


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 (You said you didn't want it)
  • Proprietary IE Filter (Internet Explorer only)
  • SVG Filters applied via CSS (Currently Firefox-only according to my tests)
  • Flash Applet (Overkill, heavy, and generally unpleasant.)

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜