js 動態(tài)修改css文件用到了cssRule
來源:易賢網(wǎng) 閱讀:2091 次 日期:2014-09-15 16:56:53
溫馨提示:易賢網(wǎng)小編為您整理了“js 動態(tài)修改css文件用到了cssRule”,方便廣大網(wǎng)友查閱!

js 動態(tài)修改css文件,循環(huán)用的underscore,在使用cssRule只能使用cssRule.style.padding=0px,詳細示例如下

_.find(document.styleSheets[4].cssRules,function(cssRule){

if(cssRule.selectorText && cssRule.selectorText.indexOf(".navbar-fixed-top2")>-1){

cssRule.style.position="";

cssRule.style.top = "0px";

}

if(cssRule.selectorText && cssRule.selectorText.indexOf("#pageIndi_content, #page1_l1_content, #page_appList") >-1){

cssRule.style.padding = "0px";

}

if(cssRule.selectorText && cssRule.selectorText.indexOf("#page1_index_content") >-1){

cssRule.style.padding = "0px";

}

});

循環(huán)用的underscore,在使用cssRule不能直接使用下面的代碼,否則不會生效

view sourceprint?1 cssRule.style=" left: 0;position:'';right: 0; top: 0px;z-index: 1031;";

只能使用

view sourceprint?1 cssRule.style.padding = "0px";

更多信息請查看IT技術專欄

更多信息請查看辦公軟件使用
易賢網(wǎng)手機網(wǎng)站地址:js 動態(tài)修改css文件用到了cssRule
關于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65317125(9:00—18:00) 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權所有:易賢網(wǎng)