function getStyle(obj,attr){ if(obj.currentStyle){ //for IE return obj.currentStyle[attr]; }else{ return getComputedStyle(obj,null)[attr]; } }
时间: 2024-10-26 06:53:26
function getStyle(obj,attr){ if(obj.currentStyle){ //for IE return obj.currentStyle[attr]; }else{ return getComputedStyle(obj,null)[attr]; } }