style.js

来自「有关于AD7705的众多详细资料」· JavaScript 代码 · 共 25 行

JS
25
字号
var loadCSS = function(title,URL)
{document.write('<link href="' + URL + '" rel="stylesheet" type="text/css" title="'+title+'" />');};
function loadCss(){var css=csslist[0];var cookie = parseInt(readCookie(styleStr));if(cookie){if(!isNaN (cookie))css=csslist[cookie];};loadCSS(css[0],css[1]);};
loadCss();function setActiveStyleSheet(_index){if(isNaN(_index))_index="0";var i, a,head = document.getElementsByTagName("head")[0],s=document.createElement("link");s.rel="stylesheet";s.type="text/css";s.title=csslist[parseInt(_index)][0];s.href=csslist[parseInt(_index)][1];	s.disabled = true;head.appendChild(s);s.disabled = false;	createCookie(styleStr,_index,365);for(i=0; (a = head.getElementsByTagName("link")[i]); i++){if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {a.disabled = true;	break;};};};

function loadStyle(t) {
	var cookie = parseInt(readCookie(styleStr));
	var styleList = csslist;
	var styleString;
	try
	{
		if (styleList.length > 1){
		
				styleString = '<select name="style" onchange="setActiveStyleSheet(this.options[selectedIndex].value);">';
				styleString += '<option value="0">-- CSS皮肤 --</option>';
				for (var i=0; i<styleList.length ;i++ ){
					styleString += '<option value="'+i+'" '+ (cookie == i?"selected":"")+ '>-- '+styleList[i][0]+' --</option>';
				}
				styleString += '</select>';
			document.write(styleString);
		
		}
		}catch (e){}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?