⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 popmenu1.js

📁 自动化网络办公系统全部源码officeanywheresystem
💻 JS
字号:
var x, y;
document.onmousedown=new Function(" click(event); return false;")
document.onkeypress=new Function(" press(event); return true;")
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 (e.keyCode == 69){alert("E");}
			doClick(e.keyCode,inPop);
		}
	}

}
function doClick(iCode)
{
	var Char;
	if (iCode>0)
	{
		Char=String.fromCharCode(iCode);
		Char=Char.toUpperCase();
	}else
	{
		Char=iCode
	};
	//alert(Char);
	obj=inPop.document.all["td"+Char];
	if (!obj)
	{
	}
	else
	{
		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':
				top.close();
				break;
			case 'E':
				alert("E");
				break;
			case 'D':
				alert("D");
				break;
			case 'S':
				window.location='view-source:'+window.location.href;
				break;
			case 'R':
				//alert("aaa");
				location.reload();
				break;
			}
			PopMenu.style.visibility='hidden'; 
		}
	}
}
function click(e,type) 
{
if (!e) var e = event 
if (e.button==2) 
{
winx = document.body.clientWidth;
winy = document.body.clientHeight;
x = e.clientX;
y = e.clientY;
if (type==1)
{
	if (MenuStatus==1)
	{
		x=x+187;
	}else
	{
		x=x+18;
	}
}
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+3;
PopMenu.style.top = y+4;
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";
}

⌨️ 快捷键说明

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