使用JavaScript检查浏览器的CSS属性支持? [英] Check browser CSS property support with JavaScript?
本文介绍了使用JavaScript检查浏览器的CSS属性支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有可能在JavaScript中知道客户端浏览器是否支持CSS属性?我在谈论CSS3的旋转属性。
Is it possible in JavaScript to know if a CSS property is supported by the client browser? I'm talking about the rotation properties of CSS3. I want to execute some functions only if the browser supports them.
推荐答案
我相信你可以这样做:
if ('WebkitTransform' in document.body.style
|| 'MozTransform' in document.body.style
|| 'OTransform' in document.body.style
|| 'transform' in document.body.style)
{
alert('I can Rotate!');
}
这篇关于使用JavaScript检查浏览器的CSS属性支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文