/**
* 获取元素的CSS样式属性值
*/
function css(element, attrName) {
/*if (window.getComputedStyle)
return window.getComputedStyle(element)[attrName]
return element.currentStyle[attrName];*/
return window.getComputedStyle ? getComputedStyle(element)[attrName]: element.currentStyle[attrName];
}
原文地址:https://www.cnblogs.com/kdiekdio/p/10240842.html
时间: 2024-12-28 02:36:16