function selection_attr(name
, value
) {
var fullname
= namespace(name
);
if (arguments
.length
< 2) {
if (typeof(arguments
[0]) === 'object') {
for(var item
in arguments
[0]) {
var key
= namespace(item
);
var todo
= arguments
[0][item
];
this.each((todo
== null
? (key
.local
? attrRemoveNS
: attrRemove
) : (typeof todo
=== "function"
? (key
.local
? attrFunctionNS
: attrFunction
)
: (key
.local
? attrConstantNS
: attrConstant
)))(key
, todo
));
}
return this
} else {
var node
= this.node();
return fullname
.local
? node
.getAttributeNS(fullname
.space
, fullname
.local
)
: node
.getAttribute(fullname
);
}
}
return this.each((value
== null
? (fullname
.local
? attrRemoveNS
: attrRemove
) : (typeof value
=== "function"
? (fullname
.local
? attrFunctionNS
: attrFunction
)
: (fullname
.local
? attrConstantNS
: attrConstant
)))(fullname
, value
));
}
转载请注明原文地址: https://mac.8miu.com/read-489349.html