你的位置:首页 > Java教程

[Java教程]javascript判断浏览器支持CSS3属性


function getsupportedprop(proparray){  var root=document.documentElement; //reference root element of document  for (var i=0; i<proparray.length; i++){ //loop through possible properties    if (proparray[i] in root.style){ //if property exists on element (value will be string, empty string if not set)      return proparray[i]; //return that string    }  }}var boxshadowprop=getsupportedprop([ 'OBoxShadow','WebkitTransform','MozTransform']);