function getStyle(id,styleName){
var obj = document.getElementById(id);
var style = null;
if (window.getComputedStyle) {
style = window.getComputedStyle(obj, null); // 非IE
} else {
style = obj.currentStyle; // IE
}
return style[styleName];
}
网友评论