获取css最终样式

function getStyle(obj, attr) {
if (obj.currentStyle) {
return obj.currentStyle[attr];
} else {
return document.defaultView.getComputedStyle(obj, null)[attr];
}
}
posted @ 2017-05-08 09:43  善未易明  阅读(591)  评论(0编辑  收藏  举报