var getStyle=function(){ var f=document.defaultView; return new Function('el','style',[ "style.indexOf('-')>-1 && (style=style.replace(/-(\\w)/g,function(m,a){return a.toUpperCase()}));", "style=='float' && (style='", f ? 'cssFloat' : 'styleFloat', "');return el.style[style] || ", f ? 'window.getComputedStyle(el, null)[style]' : 'el.currentStyle[style]', ' || null;'].join('')); }(); 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、 var getStyle=function(a,b){ var isIE=document.all?true:false; if(isIE){ try{ return a.currentStyle[b]; }catch(e){alert(e)} }else{ return window.getComputedStyle(a,null)[b]; } }