📄 resolution.js
字号:
checkBrowserWidth();
attachEventListener(window, "resize", checkBrowserWidth, false);
function checkBrowserWidth()
{
var theWidth = getBrowserWidth();
if (theWidth == 0)
{
var resolutionCookie = document.cookie.match(/(^|;)res_layout[^;]*(;|$)/);
if (resolutionCookie != null)
{
setStylesheet(unescape(resolutionCookie[0].split("=")[1]));
}
addLoadListener(checkBrowserWidth);
return false;
}
if (theWidth >= 960)
{
setStylesheet("Wide");
document.cookie = "res_layout=" + escape("Wide");
}
else
{
setStylesheet("");
document.cookie = "res_layout=";
}
return true;
};
function getBrowserWidth()
{
if (window.innerWidth)
{
return window.innerWidth;
}
else if (document.documentElement && document.documentElement.clientWidth != 0)
{
return document.documentElement.clientWidth;
}
else if (document.body)
{
return document.body.clientWidth;
}
return 0;
};
function setStylesheet(styleTitle)
{
var links = document.getElementsByTagName("link");
for (var i = 0; i < links.length; i++)
{
if (links[i].getAttribute("rel") == "alternate stylesheet")
{
links[i].disabled = true;
if(links[i].getAttribute("title") == styleTitle)
{
links[i].disabled = false;
}
}
}
return true;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -