我可以检测是否支持CSS滤镜效果? [英] Can I detect whether CSS filter effects are supported?

查看:123
本文介绍了我可以检测是否支持CSS滤镜效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS滤镜效果现为目前在草稿中,但已经支持chrome。它提供了对图像应用效果的可能性:

CSS Filter Effects is currently in draft, but already supported by chrome. It provides the possibility to apply effects to images:


CSS滤镜属性提供像素模糊或颜色移位之类的效果,元素。过滤器通常用于调整图像,背景或边框的渲染。

The CSS filter property provides for effects like blurring or color shifting on an element’s rendering before the element is displayed. Filters are commonly used to adjust the rendering of an image, a background, or a border.

CSS标准中包含几个实现预定义效果的函数。您还可以使用指向SVG过滤器元素的URL引用SVG中指定的过滤器。 (来源

Included in the CSS standard are several functions that achieve predefined effects. You can also reference a filter specified in SVG with a URL to an SVG filter element. (source)

就我所知,CSS过滤器效果只支持在Chrome 18+,但是是否可以通过JavaScript或一些CSS技巧来检测CSS过滤器效果的可用性? p>

As far as I know, CSS filters effects are only supported in Chrome 18+ yet, however is it possible to detect the availability of CSS filter effects via JavaScript or some CSS tricks?

推荐答案

您可以使用 Modernizr 我相信CSS3功能检测的JavaScript库。

You can use the Modernizr Javascript library for CSS3 feature detection I believe.

根据以下链接(从Modernizr 2.6开始)Modernizr现在可用于CSS过滤器检测:

According to the following links, (as of Modernizr 2.6) Modernizr can now be used for CSS filter detection:

http://www.browserleaks.com/modernizr#filter

http://modernizr.com/news/ 测试改进部分)。

http://modernizr.com / news / modernizr-260 /

这篇关于我可以检测是否支持CSS滤镜效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆