if(window.对象==undefined){
window.对象=参数(window,document);
} //"参数(window,document)"是啥意思,被赋值给"window.对象"又是什么意思
})(function(window,document){
var 对象 = {};
对象.$=function(id){
return documrnt.getElementById(id);
};
对象.方法 = function(className){
if(document.getElementsByClassName){
return document.getElementsByClassName(className)
}
var children = document.getElementsByTagName('*');
var 数组 = [];
for(var i=0;i
var classNames = child.className.split(' ');
for(var j=0;j
数组.push(child);
break;
}
}
}
return 数组;
}
对象.getTop = function(El){
var top = 0;
do{
top += El.offsetTop;
}while((El = El.offsetParent).nodeName !='BODY');
return top;
};
return 对象;
})