📄 0114.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- saved from url=(0032)http://www.ie-zone.com/index.php --><HTML><HEAD><style> #all .menu{cursor: default; display: none; cursor: hand; position: absolute; top: 0; left: 0; background-color: "#CFCFCF"; border: "1 solid"; border-top-color: "#EFEFEF"; border-left-color: "#EFEFEF"; border-right-color: "#505050"; border-bottom-color: "#505050"; font-size: 8pt; font-family: Arial;margin:0pt;padding: 3pt;overflow: hidden;} #all .menu SPAN {width: 100%; cursor: default;padding-left: 10pt} #all .menu SPAN.selected {background: navy; color:white}</style><xml id="contextDef"> <xmldata> <contextmenu id="demo"> <item id="viewsource" value="查看源代码"/> <item id="back" value="后退"/> </contextmenu> </xmldata></xml><script>// Define global script variablesvar bContextKey=false;// The fnDetermine function performs most of the workfunction fnGetContextID(el) { while (el!=null) { if (el.contextmenu) return el.contextmenu el = el.parentElement } return ""}function fnDetermine(){ oWorkItem=event.srcElement; // Proceed if the desired keyboard key is pressed. if(bContextKey==true){ // If the menu STATUS is false, continue. if(oContextMenu.getAttribute("status")=="false"){ // Give the menu mouse capture so it can interact better with the page. oContextMenu.setCapture(); // Relocate the menu to an offset from the mouse position. oContextMenu.style.top=event.clientY + document.body.scrollTop + 1; oContextMenu.style.left=event.clientX + document.body.scrollLeft + 1; oContextMenu.innerHTML=""; // Set its STATUS to true. var sContext = fnGetContextID(event.srcElement) if (sContext!="") { fnPopulate(sContext) oContextMenu.setAttribute("status","true"); event.returnValue=false; } else event.returnValue=true } } else{ // If the keyboard key was not pressed and the menu status is true, continue. if(oContextMenu.getAttribute("status")=="true"){ // If the object that was clicked has the menu for a parent and it has a COMPONENT attribute equal to "menuitem", continue. if((oWorkItem.parentElement.id=="oContextMenu")&&(oWorkItem.getAttribute("component")=="menuitem")){ fnFireContext(oWorkItem) } // Reset the context menu, release mouse capture, and hide it. oContextMenu.style.display="none"; oContextMenu.setAttribute("status","false"); oContextMenu.releaseCapture(); oContextMenu.innerHTML=""; event.returnValue=false; } }} function fnPopulate(sID) { var str="" var elMenuRoot = document.all.contextDef.XMLDocument.childNodes(0).selectSingleNode('contextmenu[@id="' + sID + '"]') if (elMenuRoot) { for(var i=0;i<elMenuRoot.childNodes.length;i++) str+='<span component="menuitem" menuid="' + elMenuRoot.childNodes[i].getAttribute("id") + '" id=oMenuItem' + i + '>' + elMenuRoot.childNodes[i].getAttribute("value") + "</SPAN><BR>" oContextMenu.innerHTML=str; oContextMenu.style.display="block"; oContextMenu.style.pixelHeight = oContextMenu.scrollHeight }}function fnFireContext(oItem) { switch (oItem.menuid) { case "viewsource": location.href = "view-source:" + location.href break; case "back": history.back() break; default: alert("You Selected:\nID: " + oItem.menuid + "\nText: " + oItem.innerText) }}/* The chirp functions provide visual appeal. Notice that they are specific about only changing styles while the mouse is within the client window. This is because setCapture allows the mouse to pick up coordinate values on the window (not the user's screen) and this can throw an error if you try to get a property from an object that isn't recognized. */function fnChirpOn(){ if((event.clientX>0)&&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight)){ oWorkItem=event.srcElement; if(oWorkItem.getAttribute("component")=="menuitem"){ oWorkItem.className = "selected" } }}function fnChirpOff(){ if((event.clientX>0)&&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight)){ oWorkItem=event.srcElement; if(oWorkItem.getAttribute("component")=="menuitem"){ oWorkItem.className = "" } }}function fnInit(){ if (oContextMenu) { oContextMenu.style.width=110; oContextMenu.style.height=document.body.offsetHeight/2; oContextMenu.style.zIndex=2; // Setup the basic styles of the context menu. document.oncontextmenu=fnSuppress; }}function fnInContext(el) { while (el!=null) { if (el.id=="oContextMenu") return true el = el.offsetParent } return false}function fnSuppress(){ if (!(fnInContext(event.srcElement))) { oContextMenu.style.display="none"; oContextMenu.setAttribute("status","false"); oContextMenu.releaseCapture(); bContextKey=true; } fnDetermine(); bContextKey=false;}window.onload = fnInit;document.onclick = fnDetermine;</script><TITLE>Cool的右键菜单</TITLE><META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK href="../../fav.ico" rel="shortcut icon"><STYLE type=text/css>BODY { MARGIN: 25px 25px 25px}#all TD { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}INPUT { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}SELECT { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}P { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}TEXTAREA { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}#all A:active { COLOR: #7d070c}#all A:visited { COLOR: #7d070c}#all A:hover { COLOR: #336699}#all A:link { COLOR: #7d070c}</STYLE><SCRIPT language=JavaScript><!--function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");}function JM_cc(ob){var obj=MM_findObj(ob); if (obj) { obj.select();js=obj.createTextRange();js.execCommand("Copy");}}function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x;}//--></SCRIPT><META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD><BODY id=all text=#000000 bgColor=#336699 contextmenu=demo> <div status="false" onmouseover="fnChirpOn()" onmouseout="fnChirpOff()" id="oContextMenu" class="menu"></div><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="../images/sq_1.gif" width=11 height="14"></TD> <TD width="100%"></TD> <TD><IMG src="../images/sq_2.gif" width=11 height="14"></TD> </TR></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="../../images/space.gif" width=11 height="1"></TD> <TD width="100%"> <table width="100%" border="0" cellpadding="8"> <tr> <td align="center"> <script language="JavaScript">document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>");</script> </td> </tr> <tr> <td bgcolor="#f7f7f7">提示:试试按下鼠标右键. </td> </tr> <tr> <td><img src="img/step.gif" width="30" height="30">.将下面的代码复制到 <body> 或者 <head> 内 <input type="button" name="Button" value="复制到我的剪贴板" onClick=JM_cc('js_1')> <br> <form name="form1" method="post" action=""> <textarea name="js_1" wrap="VIRTUAL" cols="80" rows="10"><style> .menu{cursor: default; display: none; cursor: hand; position: absol "1 solid"; border-top-color: "#EFEFEF"; border-left-color: "#EFEFEF"; border-right-color: "#505050"; border-bottom-color: "#505050"; font-size: 8pt; font-family: Arial;margin:0pt;padding: 3pt;overflow: hidden;} .menu SPAN {width: 100%; cursor: default;padding-left: 10pt} .menu SPAN.selected {background: navy; color:white}</style><xml id="contextDef"><xmldata>ute; top: 0; left: 0; background-color: "#CFCFCF"; border:<contextmenu id="demo"><item id="viewsource" value="View Source"/><item id="back" value="Back..."/></contextmenu><contextmenu id="demob"><item id="menu6" value="item6" /><item id="menu8" value="item7" /></contextmenu></xmldata></xml><script>// Define global script variablesvar bContextKey=false;// The fnDetermine function performs most of the workfunction fnGetContextID(el) { while (el!=null) { if (el.contextmenu) return el.contextmenu el = el.parentElement } return "" }function fnDetermine(){ oWorkItem=event.srcElement; // Proceed if the desired keyboard key is pressed. if(bContextKey==true){ // If the menu STATUS is false, continue. if(oContextMenu.getAttribute("status")=="false"){ // Give the menu mouse capture so it can interact better with the page. oContextMenu.setCapture(); // Relocate the menu to an offset from the mouse position. oContextMenu.style.top=event.clientY + document.body.scrollTop + 1; oContextMenu.style.left=event.clientX + document.body.scrollLeft + 1; oContextMenu.innerHTML=""; // Set its STATUS to true. var sContext = fnGetContextID(event.srcElement) if (sContext!="") { fnPopulate(sContext) oContextMenu.setAttribute("status","true"); event.returnValue=false; } else event.returnValue=true } } else{ // If the keyboard key was not pressed and the menu status is true, continue. if(oContextMenu.getAttribute("status")=="true"){ // If the object that was clicked has the menu for a parent and it has a COMPONENT attribute equal to "menuitem", continue. if((oWorkItem.parentElement.id=="oContextMenu")&&(oWorkItem.getAttribute("component")=="menuitem")){ fnFireContext(oWorkItem) } // Reset the context menu, release mouse capture, and hide it. oContextMenu.style.display="none"; oContextMenu.setAttribute("status","false"); oContextMenu.releaseCapture(); oContextMenu.innerHTML=""; event.returnValue=false; } } }function fnPopulate(sID) { var str="" var elMenuRoot = document.all.contextDef.XMLDocument.childNodes(0).selectSingleNode('contextmenu[@id="' + sID + '"]') if (elMenuRoot) { for(var i=0;i<elMenuRoot.childNodes.length;i++) str+='<span component="menuitem" menuid="' + elMenuRoot.childNodes[i].getAttribute("id") + '" id=oMenuItem' + i + '>' + elMenuRoot.childNodes[i].getAttribute("value") + "</SPAN><BR>" oContextMenu.innerHTML=str; oContextMenu.style.display="block"; oContextMenu.style.pixelHeight = oContextMenu.scrollHeight } }function fnFireContext(oItem) { switch (oItem.menuid) { case "viewsource": location.href = "view-source:" + location.href break; case "back": history.back() break; default: alert("You Selected:\nID: " + oItem.menuid + "\nText: " + oItem.innerText) } }/* The chirp functions provide visual appeal. Notice that they are specific about only changing styles while the mouse is within the client window. This is because setCapture allows the mouse to pick up coordinate values on the window (not the user's screen) and this can throw an error if you try to get a property from an object that isn't recognized. */ function fnChirpOn(){ if((event.clientX>0)&&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight)){ oWorkItem=event.srcElement; if(oWorkItem.getAttribute("component")=="menuitem"){ oWorkItem.className = "selected" } } } function fnChirpOff(){ if((event.clientX>0)&&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight)){ oWorkItem=event.srcElement; if(oWorkItem.getAttribute("component")=="menuitem"){ oWorkItem.className = "" } } }function fnInit(){ if (oContextMenu) { oContextMenu.style.width=110; oContextMenu.style.height=document.body.offsetHeight/2; oContextMenu.style.zIndex=2; // Setup the basic styles of the context menu. document.oncontextmenu=fnSuppress; } }function fnInContext(el) { while (el!=null) { if (el.id=="oContextMenu") return true el = el.offsetParent } return false }function fnSuppress(){ if (!(fnInContext(event.srcElement))) { oContextMenu.style.display="none"; oContextMenu.setAttribute("status","false"); oContextMenu.releaseCapture(); bContextKey=true; } fnDetermine(); bContextKey=false; } window.onload = fnInit; document.onclick = fnDetermine; </script></textarea> </form> <br> <img src="img/step2.gif" width="30" height="30"> 修改<body>加入 <font color="#990000">contextmenu=demo</font> 如本页修改为 <body <font color="#990000">contextmenu=demo</font>><br> <br> <img src="img/step3.gif" width="30" height="30"> 在<body>后加
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -