惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
V
Visual Studio Blog
小众软件
小众软件
MyScale Blog
MyScale Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
C
Comments on: Blog
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
A
Arctic Wolf
有赞技术团队
有赞技术团队
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
Security Latest
Security Latest
Webroot Blog
Webroot Blog
C
Cisco Blogs
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
博客园 - 叶小钗
K
Kaspersky official blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
H
Hacker News: Front Page
D
Darknet – Hacking Tools, Hacker News & Cyber Security
D
Docker
P
Palo Alto Networks Blog
The Register - Security
The Register - Security
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志

博客园 - 白沙

web菜单的实现【zt】 深入浅出理解索引结构[zt] 你真的了解.NET中的String吗? 堆和栈的区别 软件团队的建设和软件开发管理[zz老秦] 简单的SOCKET传送文件和字符串实现 类与结构的区别 C#中ref和out的使用小结 CSS中expression使用简介(转载) 特效:CSS+Javascript实现表格背景变色 C#箴言:定义常量的两种方法 网页弹出窗口代码【来源于网络】 注意document中需要对象的方式,区别下面四种 jsp对checkbox的操作 div的操作 How to populate the datagrid on background thread with data binding by using Visual C# Good morning I'm very happy to come here to study with you 在 ASP.NET 中执行 URL 重写
自定义鼠标右键弹出式菜单
白沙 · 2007-06-29 · via 博客园 - 白沙

<html>
    
<head>
        
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        
<title>自定义鼠标右键弹出式菜单</title>
        
<style type="text/css">
            .div1 
{ border-top:buttonface 1px solid;border-left:buttonface 1px solid;border-bottom:windowframe 1px solid;border-right:windowframe 1px solid;}
            .div2 
{ border-top:window 1px solid;border-left:window 1px solid;border-bottom:buttonshadow 1px solid;border-right:buttonshadow 1px solid;}
            .MouseOver 
{background-color:highlight;color:highlighttext;font-size: 12px;cursor:hand;font-size: 12px;}
            .MouseOut 
{background-color:buttonface;color:buttontext;font-size: 12px;cursor:default;font-size: 12px;}
        
</style><script language="javascript">//弹出菜单
            function PopupMouseRightButtonUpMenu()
            {
                
//显示菜单
                if(MouseMenu.style.visibility=='visible') MouseMenu.style.visibility='hidden';
                
//如果是链接、文本区或输入框,则显示IE菜单
                
                
if (event.srcElement.tagName=='A' || event.srcElement.tagName=='TEXTAREA' || event.srcElement.tagName=='INPUT' || document.selection.type!='None')
                    
return true;
                
else
                {
                    
//防止菜单出格
                    if (event.clientX+150 > document.body.clientWidth) MouseMenu.style.left=event.clientX+document.body.scrollLeft-150;
                    
else MouseMenu.style.left=event.clientX+document.body.scrollLeft;
                    
if (event.clientY+DivH > document.body.clientHeight) MouseMenu.style.top=event.clientY+document.body.scrollTop-DivH;
                    
else MouseMenu.style.top=event.clientY+document.body.scrollTop;
                    MouseMenu.style.visibility
='visible';
                }
                
//禁止IE菜单
                return false;
            }
            
            
//画出菜单,但不显示
            function OpenChild() 
            {
                
var ParmA = "";
                
var ParmB = "";
                
var ParmC = "";
                
var MyArgs = new Array(ParmA, ParmB, ParmC);
                
var WinSettings = "center:yes;resizable:no;dialogHeight:300px"
                
//ALTER BELOW LINE - supply correct URL for Child Form
                var MyArgs = window.showModalDialog("ChildWebForm.htm", MyArgs, WinSettings);
                
if (MyArgs == null)
                {
                    window.alert(
"Nothing returned from child. No changes made to input boxes")
                }
                
else
                {
                    retvalA.value
=MyArgs[0].toString();
                    retvalB.value
=MyArgs[1].toString();
                    retvalC.value
=MyArgs[2].toString();
                }
            }
            
            
function tete()
            {
                
var a="adfasdf";
                alert(a);
            }
            
            
function DrawMouseRightButtonUpMenu(){
                DivH
=2;
                
//oSelection = document.selection;
                var HrStr='<tr><td align=\"center\" valign=\"middle\" height=\"2\"><TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"128\" height=\"2\"><tr><td height=\"1\" bgcolor=\"buttonshadow\"><\/td><\/tr><tr><td height=\"1\" bgcolor=\"buttonhighlight\"><\/td><\/tr><\/TABLE><\/td><\/tr>';
                
var MenuItemStr1='<tr><td align=\"center\" valign=\"middle\" height=\"20\"><TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"132\"><tr><td valign=\"middle\" height=\"16\" class=\"MouseOut\" onMouseOver=\"this.className=\'MouseOver\'\" onMouseOut=\"this.className=\'MouseOut\'\" onclick=\"'
                var MenuItemStr2=
"<\/td><\/tr><\/TABLE><\/td><\/tr>";
                var historyMenu=['window.history.back()\
">后退','window.history.forward()\">前进'];
                var SysMenu=['\
">查找 <INPUT TYPE=\"text\" Size=\"10\" onkeypress=\"if (event.keyCode == 13) {MouseMenu.style.visibility=\'hidden\';var temp = this.value; this.value = \'\';return findInPage(temp)}\";\'>',
                            'document.execCommand(\'SelectAll\')\
">全选',
                            'MouseMenu.style.visibility=\'hidden\';document.execCommand(\'SaveAs\',\'true\')\
">另存为 ',
                            'location.replace(\'view
-source:\'+location.href)\">查看源文件',
                            'MouseMenu.style.visibility=\'hidden\';OpenChild()\
">打印',
                            'tete()\
">刷新'];

                var MenuStr='';
                for(i=0;i<historyMenu.length;i++)
                {
                    MenuStr+=MenuItemStr1+historyMenu[i]+MenuItemStr2;
                    DivH+=20;
                }
                MenuStr+=HrStr;
                for(i=0;i<arguments.length;i++)
                {
                    MenuStr+=MenuItemStr1+arguments[i]+MenuItemStr2;
                    DivH+=20;
                }

                if(arguments.length>0)
                {
                    MenuStr+=HrStr;
                    DivH+=2;
                }

                for(i=0;i<SysMenu.length;i++)
                {
                    MenuStr+=MenuItemStr1+SysMenu[i]+MenuItemStr2;
                    DivH+=20;
                }

                var aboutMenu=['MouseMenu.style.visibility=\'hidden\';alert(\'http:\/\/www.playyuer.com\\nmailto:playyuer@263.net\')

">关于 ']
                MenuStr
+=HrStr;
                
for(i=0;i<aboutMenu.length;i++)
                {
                    MenuStr
+=MenuItemStr1+aboutMenu[i]+MenuItemStr2;
                    DivH
+=20;
                }
var MenuTop = '<DIV id=\"MouseMenu\" class=\"div1\" style=\"position:absolute; left:0px; top:0px; width=150;height='+DivH+'; z-index:1; visibility:hidden;\">\n' +
                            '
<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"div2\">\n' +
                            '
<tr>\n' +
                            '
<td bgcolor=\"' + MenuBarColor+ '\" width=\"50\" valign=\"bottom\" align=\"center\"  bgcolor=\"buttonface\">\n' +
                            '
<\/td>\n'+ 
                            '
<td bgcolor=\"buttonface\">\n'+ 
                            '
<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\">';
                
var MenuBottom = '<\/TABLE><\/td><\/tr><\/TABLE><\/DIV>';
                document.write(MenuTop
+MenuStr+MenuBottom);
                
//prompt('aa',MenuTop+MenuStr+MenuBottom)
                document.body.oncontextmenu=new Function('return PopupMouseRightButtonUpMenu();');
                document.body.onclick
=new Function('if(event.srcElement.tagName !=\'INPUT\') MouseMenu.style.visibility=\'hidden\'');
                document.body.onscroll
=new Function('MouseMenu.style.visibility=\'hidden\';');
                document.body.onselectstart
=new Function('MouseMenu.style.visibility=\'hidden\';');
                window.onresizestart
=new Function('MouseMenu.style.visibility=\'hidden\';');
            }
            
var NS4 = (document.layers);
            
var IE4 = (document.all);
            
var win = window;
            
var n = 0;</script>
    
</head>
    
    
<body>
        自定义鼠标右键弹出式菜单 
<href="http://hsxixi.cnblogs.com">坐看云起Blog</a>
        
        
<SCRIPT LANGUAGE="JavaScript">
            
var MenuBarColor ='#6600FF';
            DrawMouseRightButtonUpMenu();
        
</SCRIPT>
    
</body>
</html>