javascript - html/javascript - 去饱和/灰度图像翻转而不创建图像副本或 Sprite

标签 javascript jquery html css rollover

我想对我的图像进行灰度到彩色图像翻转,但我不想使用需要创建图像副本的技术,而且我想避免 Sprite 。这可能吗?我该怎么做呢?

最佳答案

可以使用 Canvas 和一些 JS。 这是一个工作示例: http://jsfiddle.net/meo/csbaf/

http://www.ajaxblender.com/howto-convert-image-to-grayscale-using-javascript.html (您需要预加载图像...)

PS: 甚至还有 IE 的回退

关于javascript - html/javascript - 去饱和/灰度图像翻转而不创建图像副本或 Sprite ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8173646/

相关文章:

javascript - 使用 vis.js 从 json 文件填充节点和链接

javascript - 如何使用 React 测试库测试点击事件的 stopPropagation?

c# - ASP.Net Ajax 照片上传

javascript - 在 HTML 文件中定义 jQuery 原型(prototype)的顺序重要吗?

javascript - 错误框 div 来来去去

javascript - 测试 promise 直到超时 sinon chai 才解决

javascript - 添加event.preventDefault()会杀死SoundJS

javascript - 如何更改标签文字?

javascript - 如何在提交mongodb和meteor时获取变量

html - 是否有关于哪个 block 元素应该创建边距的约定?