<scripttype="text/javascript">通过这个盒子的属性名来获取属性值(条件是兼容所有浏览器)//varoDiv=document.getElementById("oDiv");/*functiongetCss(curEle,attr){varval=null;try{val=window.getComputedStyle(curEle,null)[attr];}catch(e){val=curEle.currentStyle[attr];}returnval;}console.log(getCss(oDiv,"width"));*//*functiongetCss(curEle,attr){varval=null;if("getComputedStyle"inwindow){val=window.getComputedStyle(curEle,null)[attr];}else{val=curEle.currentStyle[attr];}returnval;}console.log(getCss(oDiv,"width"));*//*functiongetCss(curEle,attr){varval=null;if(window.getComputedStyle){val=window.getComputedStyle(curEle,null)[attr];}else{val=curEle.currentStyle[attr];}returnval;}console.log(getCss(oDiv,"width"));*//*functiongetCss(curEle,attr){varval=null;if(/MSIE(6|7|8)/.test(window.navigator.userAgent)){val=curEle.currentStyle[attr];}else{val=window.getComputedStyle(curEle,null)[attr];}returnval;}console.log(getCss(oDiv,"width"));*/</script>