检测与Modernizr的-webkit-apperance [英] Detecting for -webkit-apperance with Modernizr

查看:208
本文介绍了检测与Modernizr的-webkit-apperance的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何使用Modernizr检测-webkit外观,moz-apperance或外观?

Can anyone tell me how to detect -webkit-appearance, moz-apperance, or appearance using Modernizr?

我有自定义选择,我需要确保附加样式不适用于不支持这些属性的浏览器。

I have custom selects, and checkboxes that use these and I need to ensure the additional styles are not applied on those browser that dont support these properties.

感谢

推荐答案

我很确定Modernizr不包括这个功能的检测程序 - 它只是太新了。

I'm pretty certain that Modernizr doesn't include a detection routine for this feature yet -- it's just too new.

但是,因为它是一个CSS属性,你应该能够检测它相当简单,而不需要调用modernizr。

However, as it's a CSS property, you should be able to detect it fairly simply for yourself without needing to invoke modernizr.

此页面详细介绍了如何快速检查CSS属性是否为

This page details how to do a quick check to detect if a CSS property is available.

只需检查属性是否存在于任何给定DOM元素的 style 属性中。如果支持该属性,它将在DOM中,即使它实际上没有设置为任何东西。

Simply check whether the property exists in the style property of any given DOM element. If the property is supported, it will be in the DOM, even if it isn't actually set to anything.

希望有帮助。

这篇关于检测与Modernizr的-webkit-apperance的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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