本文介绍了如何将灰度jquery插件应用于背景图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用将图像颜色转换为其各自的灰度。使用它非常简单,标识图像并应用插件:

I want to use the jquery-grayscale that converts images colors to their respective grayscale. Use it is very simple, identify the image and apply the plugin:

$('#my-icon').grayscale()

但是如果图像在css文件中定义为背景-image

But how to do it if the image is defined in a css file as a background-image?

#my-icon{ background-image:url('../Images/my-icon.png'); }

感谢.-

当然任何其他方式转换为灰度这些图标是有用的。任何想法?

Of course any other way to convert to grayscale these icons is useful too. Any idea?

推荐答案

我想你使用?看看代码,它只是似乎支持< img src =...> 图像,所以你要么修改它,或希望别人做。

I suppose you are using this plugin? Looking at the code it only seems to support <img src="..."> images so you'll either have to modify it or hope that someone else does.

这篇关于如何将灰度jquery插件应用于背景图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 13:20
查看更多