我在一个项目中工作,大部分时间我都必须导入computed style...html divs所以我尝试在下创建一个自定义prototype,Object以使我的代码变得更好、更简单、更短......这是适合我的代码...
Object.prototype.css=function(){
return window.getComputedStyle(this);
}
什么时候var a是node一个html div,我需要height那个div,我必须使用prototype下面的...
a.css().height;
现在的问题是......我怎样才能修改我function的使用prototype...
a.css.height; // css insead of css()
请不要 jQuery...