Base.prototype.css = function (attr, value) { for (var i = 0; i < this.elements.length; i ++) { if (arguments.length == 1) { if (typeof window.getComputedStyle != ‘undefined‘) { return window.getComputedStyle(this.elements[i], null)[attr]; } else if (typeof this.elements[i].currentStyle != ‘undefined‘) { return this.elements[i].currentStyle[attr]; } } else { this.elements[i].style[attr] = value; } } return this; }
时间: 2024-10-12 17:15:51