obj: 元素对象
attribute: 属性
返回值:该对象这个属性的值
function getDefaultStyle(obj,attribute){ // 返回最终样式函数,兼容IE和DOM,设置参数:元素对象、样式特性 return obj.currentStyle?obj.currentStyle[attribute]:document.defaultView.getComputedStyle(obj,false)[attribute]; }
完整链接:http://www.css88.com/archives/625