getStyle函数
window.getStyle = (document.body.currentStyle //这样做是为了让函数有“记性”,不用每次使用这函数的时候都判断一次
? function (obj, attribute){
obj.currentStyle[attribute]
} : document.defaultView
? function (obj, attribute){
return document.defaultView.getComputedStyle(obj,false)[attribute];
} : function (){
return null;
}//IE下body的width为auto,要换clientWidth
)
作者:阿良
出处:http://www.cnblogs.com/arliang
本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议
进行许可,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。

浙公网安备 33010602011771号