自定义网页右键

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

<!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>

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值