自定义网页右键

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </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 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>

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: javascript
想对作者说点什么? 我来说一句

隐藏Win7菜单栏

隐藏Win7菜单栏

dz45693 dz45693

2010-06-17 15:45:00

阅读数:2769

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭