<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<title>系统菜单-51windows.Net</title>
<head>
<meta name="keywords" content="51windows.Net">
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
</head>
<body οnmοusemοve="MoveObj()" οnmοusedοwn="MoveObj()" οnmοuseup="MoveObj()">
<p>请点右键</p>
<object id="objContent" classid="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A" style="position: absolute; top: 0; left: 0;width:1;height:1;"></object>
<SCRIPT LANGUAGE="JavaScript">
<!--
var ContextMenu = new Array() ;
function ContextMenuItem(text, command, state){
this.Text = text ;
this.Command = command || "void(0)" ;
this.state = state;
}
ContextMenu[0] = new ContextMenuItem("前进(&B)","go(1)",0);
ContextMenu[1] = new ContextMenuItem("后退(&O)","go(-1)",2);
ContextMenu[2] = new ContextMenuItem("未选中(&S)","s()",0);
ContextMenu[3] = new ContextMenuItem("","",0);
ContextMenu[4] = new ContextMenuItem("无忧视窗(&W)","window.open('http://www.51windows.Net')",0);
for (i = 5 ; i < 10; i++ ){
ContextMenu[i] = new ContextMenuItem("菜单 (&"+i+")","ContextMenu["+i+"].state=(ContextMenu["+i+"].state==0)?1:0",0);
}
function s(){
if (ContextMenu[2].Text == "选中(&S)"){
ContextMenu[2].Text = "未选中(&S)";
ContextMenu[2].state = 0;
}
else{
ContextMenu[2].Text = "选中(&S)";
ContextMenu[2].state = 1;
}
}
function go(n){
ContextMenu[0].state = (n==1)?2:0;
ContextMenu[1].state = (n==1)?0:2;
}
function showContextMenu(iMenu){
var i ;
var menuStrings = new Array();
var menuStates = new Array();
for ( i = 0 ; i < ContextMenu.length ; i++ ){
menuStrings[i] = ContextMenu[i].Text ;
menuStates[i] = ContextMenu[i].state ;
}
objContent.SetContextMenu(menuStrings, menuStates);
}
function MoveObj(){
objContent.style.top = window.event.y-2
objContent.style.left = window.event.x-2
}
//-->
</SCRIPT>
<script language="javascript" event="ShowContextMenu" for="objContent">
<!--
showContextMenu(ContextMenu) ;
//-->
</script>
<script language="javascript" event="ContextMenuAction(itemIndex)" for="objContent">
<!--
eval(ContextMenu[itemIndex].Command);
//-->
</script>
</body>
</html>