系统右键菜单 - 51windows.Net
51windows.Net
>
脚本收藏
>
控件类
> 系统右键菜单
系统右键菜单
<!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 onmousemove="MoveObj()" onmousedown="MoveObj()" onmouseup="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>
网站推荐:
虎的笑话
虎的成语
虎的歇后语
在线小游戏
成语排行榜
歇后语排行榜
中华五千年
文革图片
转载本站内容,请务必保留原作者信息。
本站提供的内容部分是在网上搜集,如果侵犯了您的版权,请告之,我们会删除内容或加上您的信息。(
网站留言
、
站内搜索
)