📄 main.js
字号:
function isMatch(str1,str2)
{
var index = str1.indexOf(str2);
if(index==-1) return false;
return true;
}
function ResumeError() {
return true;
}
window.onerror = ResumeError;
function $(id) {
return document.getElementById(id);
}
// 相对尺寸
function GetOffsetTop (el, p) {
var _t = el.offsetTop;
var _p = el.offsetParent;
while (_p) {
if (_p == p) break;
_t += _p.offsetTop;
_p = _p.offsetParent;
}
return _t;
};
function GetOffsetLeft (el, p) {
var _l = el.offsetLeft;
var _p = el.offsetParent;
while (_p) {
if (_p == p) break;
_l += _p.offsetLeft;
_p = _p.offsetParent;
}
return _l;
};
function showMenu (baseID, divID) {
baseID = $(baseID);
divID = $(divID);
//var l = GetOffsetLeft(baseID);
//var t = GetOffsetTop(baseID);
//divID.style.left = l + 'px';
// divID.style.top = t + baseID.offsetHeight + 'px';
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
showMenu.cur = divID;
if (! divID.isCreate) {
divID.isCreate = true;
//divID.timer = 0;
divID.onmouseover = function () {
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
};
function hide () {
showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
}
divID.onmouseout = hide;
baseID.onmouseout = hide;
}
function hideCur () {
showMenu.cur && (showMenu.cur.style.display = 'none');
}
}
function doClick_down(o){
o.className="current";
var j;
var id;
var e;
for(var i=1;i<=7;i++){
id ="down"+i;
j = document.getElementById(id);
e = document.getElementById("d_con"+i);
if(id != o.id){
j.className="";
e.style.display = "none";
}else{
e.style.display = "block";
}
}
}
function doClick_jy(o){
o.className="current";
var j;
var id;
var e;
for(var i=1;i<=8;i++){
id ="jy"+i;
j = document.getElementById(id);
e = document.getElementById("jy_con"+i);
if(id != o.id){
j.className="";
e.style.display = "none";
}else{
e.style.display = "block";
}
}
}
function doZoom(size){
document.getElementById('textbody').style.fontSize=size+'px'
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -