标签:
/*判断浏览器是否支持某个css属性*/ function SupportCss(attrName){ var i=0, arr = SupportCss.opt.aBrowser, eleStyle = SupportCss.opt.eleStyle; for(i;i<arr.length ;i++){ if(arr[i] + attrName in eleStyle){return true;} } return false; } /*构造函数静态属性*/ SupportCss.opt = { /*浏览器前缀*/ aBrowser : [‘‘, ‘-webkit-‘, ‘-Moz-‘, ‘-ms-‘, ‘-o-‘], /*页面对象*/ eleStyle : document.documentElement.style }; console.log(‘transition:‘,SupportCss(‘transition‘)); console.log(‘width:‘,SupportCss(‘width‘));
标签:
原文地址:http://www.cnblogs.com/dtdxrk/p/4318314.html