📄 popmenu.js
字号:
var x, y;
document.onmousedown=new Function(" click(event); return false;")
document.onkeypress=new Function(" press(event); return false;")
MSIEIndex = navigator.userAgent.indexOf("MSIE");
netscap = ((MSIEIndex) == -1);
function press(e)
{
if (PopMenu.style.visibility!="hidden")
{
//alert(event.keyCode);
if (netscap)
{
doClick(e.which);
}
else
{
//if (event.keyCode == 69){alert("E");}
doClick(e.keyCode);
}
}
}
function doClick(iCode)
{
var Char;
if (iCode>0)
{
Char=String.fromCharCode(iCode);
Char=Char.toUpperCase();
}else
{
Char=iCode
};
//alert(Char);
obj=document.all["td"+Char];
if (obj.disabled)
{
}
else
{
switch (Char)
{
case 'B':
history.back();
break;
case 'O':
history.forward();
break;
case 'X':
location.href="/indexFrame-main.htm";
break;
case 'Q':
window.close();
break;
case 'E':
alert('12');
break;
case 'S':
window.location='view-source:'+window.location.href;
break;
case 'R':
//alert("aaa");
location.reload();
break;
}
}
}
function click(e)
{
if (!e) var e = event
if (e.button==2)
{
winx = document.body.clientWidth;
winy = document.body.clientHeight;
x = e.clientX;
y = e.clientY;
if ((x+menuWidth)>winx)
{
x=x-menuWidth;
}
if ((y+menuHeight)>winy)
{
y=y-menuHeight;
}
PopMenu.style.visibility='hidden';
window.setTimeout("showMenu();", 500);
}
else
{
PopMenu.style.visibility='hidden';
}
}
function showMenu()
{
//--------- judge disable -----------
if (window.history.length>0)
{
document.all["tdB"].disabled=false;
}
//-----------------------------------
PopMenu.style.left = x;
PopMenu.style.top = y;
PopMenu.style.visibility="";
}
function MouseEvents() {
document.onmousedown = new Function(" click(event); return false;")
document.oncontextmenu = new Function("return false;");
}
MouseEvents()
function SetOverColor(obj)
{
obj.style.backgroundColor="#08246b";
obj.style.color="FFFFFF";
}
function SetOutColor(obj)
{
obj.style.backgroundColor="d6d3ce";
obj.style.color="#000000";
}
function SetOver(sid)
{
obj=document.all["tr"+sid];
obj.style.backgroundColor="#08246b";
obj.style.color="FFFFFF";
objTD=document.all["td"+sid];
if (objTD.disabled)
{
bDisable=true;
objTD.disabled=false;
objTD.onmousedown=new Function("return false;");
document.onmousedown = new Function(" return false;")
obj.style.color="#777777";
}
}
function SetOut(sid)
{
obj=document.all["tr"+sid];
objTD=document.all["td"+sid];
if (bDisable)
{
objTD.disabled=true;
objTD.onmousedown=new Function("doClick(sid)");
document.onmousedown = new Function(" click(event); return false;")
bDisable=false;
}
obj.style.backgroundColor="d6d3ce";
obj.style.color="#000000";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -