鼠标右键菜单

None.gif<!--鼠标右键 start-->
ExpandedBlockStart.gifContractedBlock.gif
<script language="javascript">dot.gif
InBlock.gif
var historyMenu=["abc('http://pic.sohu.com')\">进入首页","this.style.behavior='url(#default#homepage)';this.setHomePage('http://pic.sohu.com');return false;\">收藏首页","copyimageurl('http://photo.pic.sohu.com/images/learning/2006-07-25/10db10d0f20.jpg');\"><font color=blue>复制图片地址</font>"];
ExpandedBlockEnd.gif

None.gif
</script>
None.gif
<!--鼠标右键 end-->
None.gif
None.gif
<!--鼠标右键-->
ExpandedBlockStart.gifContractedBlock.gif
<SCRIPT LANGUAGE="JavaScript">dot.gif
InBlock.gif
<!--
ExpandedSubBlockStart.gifContractedSubBlock.gif
function abc(a)dot.gif{
InBlock.gifwindow.location
=a;
ExpandedSubBlockEnd.gif}

InBlock.gif
var curobj = new Object(); //Current obj name
InBlock.gif
function PopupMouseRightButtonUpMenu()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gifcurobj 
= event.srcElement; 
InBlock.gif
//alert(curobj.tagName);
InBlock.gif
 if(MouseMenu.style.visibility=='visible') MouseMenu.style.visibility='hidden';
InBlock.gif 
if (event.srcElement.tagName=='A' || event.srcElement.tagName=='TEXTAREA' || event.srcElement.tagName=='INPUT' || document.selection.type!='None')
InBlock.gif    
return true;
InBlock.gif 
else
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif     
if (event.clientX+150 > document.body.clientWidth) MouseMenu.style.left=event.clientX+document.body.scrollLeft-150;
InBlock.gif     
else MouseMenu.style.left=event.clientX+document.body.scrollLeft;
InBlock.gif     
if (event.clientY+DivH > document.body.clientHeight) MouseMenu.style.top=event.clientY+document.body.scrollTop-DivH;
InBlock.gif     
else MouseMenu.style.top=event.clientY+document.body.scrollTop;
InBlock.gif     MouseMenu.style.visibility
='visible';
ExpandedSubBlockEnd.gif    }

InBlock.gif
return false;
ExpandedSubBlockEnd.gif}

ExpandedSubBlockStart.gifContractedSubBlock.gif
function DrawMouseRightButtonUpMenu()dot.gif{
InBlock.gifDivH
=2;
InBlock.gif
//oSelection = document.selection;
InBlock.gif
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>';
InBlock.gif
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=\"myMouseOut\" onMouseOver=\"this.className=\'myMouseOver\'\" onMouseOut=\"this.className=\'myMouseOut\'\" onclick=\"'
InBlock.gifvar MenuItemStr2=
"<\/td><\/tr><\/TABLE><\/td><\/tr>";
InBlock.gifvar SysMenu=[
"ImageAutoReload();\">显示图片",'document.execCommand(\'SelectAll\')\">全选',
InBlock.gif             'MouseMenu.style.visibility=\'hidden\';document.execCommand(\'SaveAs\',\'true\')\
">另存为 dot.gif',
InBlock.gif             'location.replace(\'view
-source:\'+location.href)\">查看源文件',
InBlock.gif             'MouseMenu.style.visibility=\'hidden\';window.print()\
">打印',
InBlock.gif             'window.location.reload()\
">刷新'];
InBlock.gif
InBlock.gifvar MenuStr='';
InBlock.giffor(i=0;i<historyMenu.length;i++)
InBlock.gif   {
InBlock.gif    MenuStr+=MenuItemStr1+historyMenu[i]+MenuItemStr2;
InBlock.gif    DivH+=20;
InBlock.gif   }
InBlock.gifMenuStr+=HrStr;
InBlock.giffor(i=0;i<arguments.length;i++)
InBlock.gif   {
InBlock.gif    MenuStr+=MenuItemStr1+arguments[i]+MenuItemStr2;
InBlock.gif    DivH+=20;
InBlock.gif   }
InBlock.gif
InBlock.gifif(arguments.length>0)
InBlock.gif  {
InBlock.gif   MenuStr+=HrStr;
InBlock.gif   DivH+=2;
InBlock.gif  }
InBlock.gif
InBlock.giffor(i=0;i<SysMenu.length;i++)
InBlock.gif   {
InBlock.gif    MenuStr+=MenuItemStr1+SysMenu[i]+MenuItemStr2;
InBlock.gif    DivH+=20;
InBlock.gif   }
InBlock.gif
InBlock.gifvar aboutMenu=['MouseMenu.style.visibility=\'hidden\';alert(\'Copyright @ 2005 Sohu.com Inc. All rights reserved. 搜狐公司 版权所有 \')
">关于 dot.gif']
InBlock.gifMenuStr
+=HrStr;
InBlock.gif
for(i=0;i<aboutMenu.length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif   
dot.gif{
InBlock.gif    MenuStr
+=MenuItemStr1+aboutMenu[i]+MenuItemStr2;
InBlock.gif    DivH
+=20;
ExpandedSubBlockEnd.gif   }

InBlock.gif
InBlock.gif
var MenuTop = '<DIV id=\"MouseMenu\" class=\"div1\" style=\"position:absolute; left:0px; top:0px; width=150;height='+DivH+'; z-index:1; visibility:hidden;\">\n' +
InBlock.gif             '
<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"div2\">\n' +
InBlock.gif             '
<tr>\n' +
InBlock.gif             '
<td bgcolor=\"' + MenuBarColor+ '\" width=\"50\" valign=\"bottom\" align=\"center\"  bgcolor=\"buttonface\">\n' +
InBlock.gif             '
<\/td>\n'+ 
InBlock.gif             '
<td bgcolor=\"buttonface\">\n'+ 
InBlock.gif             '
<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\">';
InBlock.gif
var MenuBottom = '<\/TABLE><\/td><\/tr><\/TABLE><\/DIV>';
InBlock.gifdocument.write(MenuTop
+MenuStr+MenuBottom);
InBlock.gif
//prompt('aa',MenuTop+MenuStr+MenuBottom)
InBlock.gif//
document.body.oncontextmenu=new Function('return PopupMouseRightButtonUpMenu();');
InBlock.gif
document.body.onclick=new Function('if(event.srcElement.tagName !=\'INPUT\') MouseMenu.style.visibility=\'hidden\'');
InBlock.gifdocument.body.onscroll
=new Function('MouseMenu.style.visibility=\'hidden\';');
InBlock.gifdocument.body.onselectstart
=new Function('MouseMenu.style.visibility=\'hidden\';');
InBlock.gifwindow.onresizestart
=new Function('MouseMenu.style.visibility=\'hidden\';');
ExpandedSubBlockEnd.gif}

InBlock.gif
var NS4 = (document.layers);
InBlock.gif
var IE4 = (document.all);
InBlock.gif
var win = window;
InBlock.gif
var n = 0;
ExpandedBlockEnd.gif
//-->
None.gif
</SCRIPT>
None.gif
ExpandedBlockStart.gifContractedBlock.gif
<SCRIPT LANGUAGE="JavaScript">dot.gif
InBlock.gif
<!--
InBlock.gif
var MenuBarColor ='#6600FF';
InBlock.gifDrawMouseRightButtonUpMenu();
InBlock.gif
ExpandedBlockEnd.gif
//-->
None.gif
</SCRIPT>
None.gif
<id="pic_src" href=""><div align=center><img  class="ad" border=0 id="picid" width="210" height="300"  name='MMS' oncontextmenu='return PopupMouseRightButtonUpMenu()' src="" ></div></a>    

转载于:https://www.cnblogs.com/shengshuai/archive/2006/10/09/ContentMeun_js.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值