标签:
//addcss
Base.prototype.addcss=function(num,selectortxt,csses,ind){
var sheet=document.styleSheets[num];
if(typeof sheet.insertRule!=undefined)
{
sheet.insertRule(selectortxt+"{"+csses+"}",ind)
}
else if(sheet.addRule!=undefined)
{
sheet.addRule(selectortxt,csses,ind)
}
return this;
}
//removecss
Base.prototype.removecss=function(num,ind){
var sheet=document.styleSheets[num];
if(typeof sheet.deleteRule!=undefined)
{
sheet.deleteRule(ind)
}
else if(sheet.removeRule!=undefined)
{
sheet.removeRule(ind)
}
return this;
}
标签:
原文地址:http://www.cnblogs.com/xiaodonger/p/5352121.html