[换皮肤程序]一个比较使用的脚本程序
换肤测试程序
.themes{border:1px solid #000;}
","http://www.east-dragon.cn/code/changeskin/css/ocean.css"],
["","http://www.east-dragon.cn/code/changeskin/css/tangerine.css"],
["","http://www.east-dragon.cn/code/changeskin/css/violet.css"],
["","http://www.east-dragon.cn/code/changeskin/css/oyster.css"],
["","http://www.east-dragon.cn/code/changeskin/css/grass.css"],
""
];
// *** function to replace href="#" ***
function v(){
return;
}
// *** Cookies ***
function writeCookie(name, value) {
exp = new Date();
exp.setTime(exp.getTime() + (86400 * 1000 * 30));
document.cookie = name + "=" + escape(value) + "; expires=" + exp.toGMTString() + "; path=/";
}
function readCookie(name) {
var search;
search = name + "=";
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1){
end = document.cookie.length;
}
return unescape(document.cookie.substring(offset, end));
}else{
return "";
}
}
////////////////////////////////////
// StyleSheet
////////////////////////////////////
function writeCSS(){
for(var i=0;i');
}
setStyleSheet(readCookie("stylesheet"));
}
function writeCSSLinks(){
for(var i=0;i0) document.write(' ');
document.write(''+arrCSS[i][0]+'');
}
}
function setStyleSheet(strCSS){
var objs=document.getElementsByTagName("link");
var intFound=0;
for(var i=0;i-1&&objs[i].title){
objs[i].disabled = true;
if(objs[i].title==strCSS) intFound=i;
}
}
objs[intFound].disabled = false;
writeCookie("stylesheet",objs[intFound].title);
}
writeCSS();
setStyleSheet(readCookie("stylesheet"));
// 隐藏显示换肤框
function ShowHideDiv(init) {
if(document.getElementById("Sright").style.display == "block"){
document.getElementById("Sright").style.display = "none";
}
else{
document.getElementById("Sright").style.display = "block";
}
}
//-->
皮肤设置选项
颜色:writeCSSLinks();
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]