//addclass
Base.prototype.addclass=function(classname){
for(var i=0;i<this.elements.length;i++)
{
//去重
if(!this.elements[i].className.match(new RegExp('(\\s|^)'+classname+'($|\\s)')))
{
this.elements[i].className+=" "+classname
}
}
return this;
}
//removeclass
Base.prototype.removeclass=function(classname){
for(var i=0;i<this.elements.length;i++)
{
//去重
if(this.elements[i].className.match(new RegExp('(\\s|^)'+classname+'($|\\s)')))
{
this.elements[i].className=this.elements[i].className.replace(new RegExp('(\\s|^)'+classname+'($|\\s)'))," ")
}
}
return this;
}