直接贴代码
复制代码 代码如下:
//取元素 用两个$是为了不与jquery冲突
function $$(s) {
return document.getElementById(s);
}
function setblue() {
//先写cookie
//writeCookie("ISCSSSTYLE", "css/CRM_blue.css", 365, true);
//设置新的css文件
$$("maincss").href = "css/CRM_blue.css";
//取主框架页,并重新设置css文件
//var childobj = window.parent.document.getElementById("ManagerMain").contentWindow;
//childobj.document.getElementById("maincss").href = "css/CRM_blue.css";
}
function setgreen() {
//先写cookie
//writeCookie("ISCSSSTYLE", "css/CRM.css", 365, true);
//设置新的css文件
$$('maincss').href = "css/CRM.css";
//取主框架页,并重新设置css文件
//var childobj = window.parent.document.getElementById("ManagerMain").contentWindow;
//childobj.document.getElementById("maincss").href = "css/CRM.css";
}
function setgray() {
//先写cookie
//writeCookie("ISCSSSTYLE", "css/CRM_gray.css", 365, true);
//设置新的css文件
$$('maincss').href = "css/CRM_gray.css";
//取主框架页,并重新设置css文件
//var childobj = window.parent.document.getElementById("ManagerMain").contentWindow;
//childobj.document.getElementById("maincss").href = "css/CRM_gray.css";
}
function setActiveStyleSheet(title) {
// var i, a, main;
// for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if(a.getAttribute("rel").indexOf("style")!= -1 && a.getAttribute("title"))
// {
// a.disabled = true;
// if(a.getAttribute("title") == title)
// a.disabled = false;
// }
// }
//$$("maincss").attr("href", "css/CRM_blue.css");
//$$('maincss').href = "css/CRM_blue.css";
//设置css的文件
$$('maincss').href = title;
}
function getActiveStyleSheet() {
// var i, a;
// for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if(a.getAttribute("rel").indexOf("style")!= -1 &&
// a.getAttribute("title") && !a.disabled)
// return a.getAttribute("title");
// }
// return null;
var cssfile = $$('maincss').href;
//alert(cssfile);
return cssfile;
}
function getPreferredStyleSheet() {
// var i, a;
// for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if(a.getAttribute("rel").indexOf("style") != -1
// && a.getAttribute("rel").indexOf("alt") == -1
// && a.getAttribute("title"))
// return a.getAttribute("title");
// }
// return null;
var cssfile = $$('maincss').href;
//alert(cssfile);
return cssfile;
}
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else
expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
function writeCookie(name, value, hours, escp) {
var expire = "";
if (hours != null) {
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
if (escp == "True") {
document.cookie = name + "=" + value + expire;
} else {
document.cookie = name + "=" + escape(value) + expire;
}
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ')
c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length, c.length);
}
return null;
}
$(document).ready(function() {
//var title = readCookie("ISCSSSTYLE");
//var title = "css/CRM_blue.css";
//if (title != null && title != "undefined") {
// setActiveStyleSheet(title);
//}
});
样式切换,css
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 纪钧瀚《钢琴阅读时光 雨中书店聆听轻音乐》[FLAC/分轨][399.62MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[320K/MP3][87.4MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[FLAC/分轨][184.94MB]
- 陈慧娴.2018-Priscilla-Ism演唱会3CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 郑秀文.1999-我应该得到(国)【华纳】【WAV+CUE】
- 陈家慧.2011-钢琴酒吧2CD【龙吟唱片】【WAV+CUE】
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[320K/MP3][45.01MB]
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[FLAC/分轨][109.13MB]
- 赞多《序章》[320K/MP3][45.54MB]
- 许巍.2004-每一刻都是崭新的【步升大风】【WAV+CUE】
- 群星.2024-四方馆影视原声带【韶愔音乐】【FLAC分轨】
- 陈雷.1997-安锁咧【金圆唱片】【WAV+CUE】
- 关淑怡.2013-MY.FAVORITE.SK.3CD【环球】【WAV+CUE】
- Sweety.2006-花言乔语【丰华】【WAV+CUE】
- 李恕权.2003-回·20年全精选2CD【SONY】【WAV+CUE】