是否支持css3
2016-05-26 14:04
453 查看
/** * Function to check css3 support * @param {String} declaration name * @return {Boolean} */ function isCssSupported(declaration) { var supported = false, prefixes = 'Khtml ms O Moz Webkit'.split(' '), clone = document.createElement('div'), declarationCapital = null; declaration = declaration.toLowerCase(); if (clone.style[declaration] !== undefined) supported = true; if (supported === false) { declarationCapital = declaration.charAt(0).toUpperCase() + declaration.substr(1); for( var i = 0; i < prefixes.length; i++ ) { if( clone.style[prefixes[i] + declarationCapital ] !== undefined ) { supported = true; break; } } } if (window.opera) { if (window.opera.version() < 13) supported = false; } return supported; }
相关文章推荐
- CSS3实践之路(六):CSS3的过渡效果(transition)与动画(animation)
- CSS hack
- Draw a Tree Structure With Only CSS
- 如何提升我的HTML&CSS技术,编写有结构的代码
- CSS 3 中 -webkit-, -moz-, -o-, -ms- 这些私有前缀
- CSS3选择器学习笔记
- 图解CSS3制作圆环形进度条的实例教程
- CSS的margin属性在页面布局中的使用攻略
- cssViewer牛逼的chrome插件
- css四可见,部分可见和重叠半透明
- 来看看css3中的box-shadow
- css3之渐变
- Material Design-Button的新式样式初探
- gulp构建指令
- NPOI之Excel——合并单元格、设置样式、输入公式
- NPOI之Excel——合并单元格、设置样式、输入公式
- css 优先级总结
- 详解rotate3()
- css-三边框,外边距和内边距
- 使用CSS3 :nth-child(n) 選取器教學