龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > div+css/html >

rules与cssRules区别(ie与firefox)

时间:2012-12-31 10:44来源:未知 作者:admin 点击:
分享到:
rules与cssRules区别(ie与firefox) rules与css教程rules区别(ie与firefox) function addcssrule(css,key,value){ //var css = document.stylesheets[document.stylesheets.length-1]; if(navigator.useragent.indexof(firefox)0 ) { css.ins
rules与cssRules区别(ie与firefox)

rules与css教程rules区别(ie与firefox)

function addcssrule(css,key,value){
//var css = document.stylesheets[document.stylesheets.length-1];
if(navigator.useragent.indexof("firefox")>0 )
{
css.insertrule(key+"{"+value+"}", css.cssrules.length)
}
else
{
css.addrules(key,value);
}
}
function removecssrule(key){
for(var i = 0; i < document.stylesheets.length; i++){
var css = document.stylesheets[i];
navigator.useragent.indexof("firefox")>0 ?
(function(){
for(var j = 0; j < css.cssrules.length; j++){
if(css.cssrules[j].selectortext==key){
css.deleterule(j);
}
}
})() :
(css.removerule(key)) ;
}
}

 


精彩图集

赞助商链接