css兼容处理

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、~~

posted @ 2016-08-22 17:18  菜蛋  阅读(257)  评论(0编辑  收藏  举报