这一段代码的作用是什么?
//////////
//分解参数 //
//////////
function access(elems, fn, key, value, chainable, emptyGet, raw) {
var i = 0,
len = elems.length;
//如果是一个对象,for in递归调用自己
if (jQuery.type(key) === "object") {
chainable = true;
for (i in key) {
access(elems, fn, i, key[i], true, emptyGet, raw);
}
} else if (value !== undefined) {
if (fn) {
fn(elems, key, value);
}
}
return elems
};
//////////
//设置样式 //
//////////
function style(elem, name, value, extra) {
var origName = jQuery.camelCase(name),
style = elem.style;
style[name] = value;
}
function css(name, value) {
return access(this, function(elem, name, value) {
return value !== undefined ?
style(elem, name, value) :
jQuery.css(elem, name);
}, name, value, arguments.length > 1);
}