<!--鼠标右键 start--><script language="javascript">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>"];</script><!--鼠标右键 end--><!--鼠标右键--><SCRIPT LANGUAGE="JavaScript"><!--function abc(a){window.location=a;}var curobj = new Object(); //Current obj namefunction PopupMouseRightButtonUpMenu(){curobj = event.srcElement; //alert(curobj.tagName); if(MouseMenu.style.visibility=='visible') MouseMenu.style.visibility='hidden'; 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'; }return false;}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=\"myMouseOut\" onMouseOver=\"this.className=\'myMouseOver\'\" onMouseOut=\"this.className=\'myMouseOut\'\" onclick=\"'var MenuItemStr2="<\/td><\/tr><\/TABLE><\/td><\/tr>";var SysMenu=["ImageAutoReload();\">显示图片",'document.execCommand(\'SelectAll\')\">全选', 'MouseMenu.style.visibility=\'hidden\';document.execCommand(\'SaveAs\',\'true\')\">另存为 ', 'location.replace(\'view-source:\'+location.href)\">查看源文件', 'MouseMenu.style.visibility=\'hidden\';window.print()\">打印', 'window.location.reload()\">刷新'];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(\'Copyright @ 2005 Sohu.com Inc. All rights reserved. 搜狐公司 版权所有 \')">关于 ']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><SCRIPT LANGUAGE="JavaScript"><!--var MenuBarColor ='#6600FF';DrawMouseRightButtonUpMenu();//--></SCRIPT><a 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