📄 changestyle.js
字号:
// Example:
// alert( readCookie("cc_count_6_style") );
/*
function readCookie(name)
{
var cookieValue = "";
var search = name + "=";
alert(document.cookie);
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value)
{
var expire = "";
expire = new Date((new Date()).getTime() + 24 * 365 * 3600000);
expire = "; expires=" + expire.toGMTString();
document.cookie = name + "=" + escape(value) + expire+"; path=/;domain=www.fj10000.com";
}
*/
function GookieVal(offset)
//获得Cookie解码后的值
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function readCookie(name)
//获得Cookie的原始值
{ var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return GookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function writeCookie(name, value)
//设定Cookie值
{ var argv = writeCookie.arguments;
var argc = writeCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" +escape (value) +((expires == null) ?"" : ("; expires="+ expires.toGMTString()))+((path == null) ? "" :("; path=" + path)) +((domain == null) ?"" : ("; domain=" + domain))+((secure == true) ? "; secure" : "");
}
function Dookie(name)
{ var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = readCookie (name);
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}
function changeStyle(n){
for(var i=1;i<document.styleSheets.length;++i){
if(document.styleSheets[i].href)
document.styleSheets[i].disabled=true;
}
/*
var oCss = document.createElement("LINK");
oCss.rel="stylesheet";
oCss.type="text/css";
oCss.href=(n?"./style/Sty0"+n+".css":"./style/main.css");
document.body.appendChild(oCss)
*/
try{
var path = "";
if ( document.styleSheets.length > 0 ) {
var mURL = document.styleSheets[0].href;
path = mURL.substring(0, mURL.lastIndexOf("/"));
}
document.createStyleSheet(n?path + "/Sty0"+n+".css":path + "/main.css");
}catch(e){
//not ie?
}
writeCookie("fj10000_style",n,expdate, "/", null, false);
}
var expdate = new Date();
expdate.setTime(expdate.getTime() +(24 * 60 * 60 * 1000 * 365));
//alert (document.cookie);
var sCookiesStyle = readCookie("fj10000_style");
//alert ("Cookie Value is:"+sCookiesStyle);
if(!parseInt(sCookiesStyle)) sCookiesStyle=1;
changeStyle(sCookiesStyle);
//Dookie("netcustom_style");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -