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、~~
时间: 2024-10-07 00:56:17