您的位置:首页 > Web前端 > CSS

css兼容处理

2016-08-22 17:18 106 查看
1、js判断浏览器是否支持css3属性

function supportCss3(style){var prefix=['webkit','Moz','ms','o'],i,humpString=[],htmlStyle=document.documentElement.style,_toHumb=function(string){return string.replace(/-(\w)/g,function($0,$1){return $1.toUpperCase()})};for(i in prefix){humpString.push(_toHumb(prefix[i]+'-'+style));console.log(humpString)}humpString.push(_toHumb(style));for(i in humpString){if(humpString[i]in htmlStyle){return true}}return false}; console.warn(supportCss3('animation-fill-mode'));

2、~~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: