function getStyle(obj,attr){ return obj.currentStyle? obj.currentStyle[attr]:getComputedStyle(obj)[attr] }
使用示例:
var oDiv=document.getElementById("test");
alert(getStyle(oDiv,"top"));
Live and learn!
function getStyle(obj,attr){ return obj.currentStyle? obj.currentStyle[attr]:getComputedStyle(obj)[attr] }
使用示例:
var oDiv=document.getElementById("test");
alert(getStyle(oDiv,"top"));
Live and learn!