/* Style Switcher by Paul Sowden, see A List Apart: http://www.alistapart.com/articles/alternate/ */
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;
}
};
createCookie("test",title,30);
}
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;
}
function getPreferredStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("l
切换网页风格使用cookie存储(防止刷新丢失)
最新推荐文章于 2023-06-12 11:45:30 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)