JS获取元素样式表:
var style = null;
if (window.getComputedStyle) { //判断浏览器类型
style = window.getComputedStyle(box, null); // 非IE
} else {
style = box.currentStyle; // IE
};
所有的样式都是style的属性
例如:
元素宽度:style.width,
元素高度:style.height