接上面:if(!flag) 

Temp = eval("E_"+id); 
Temp.style.display="none"; 

Area = eval("A_"+id); 
if(Area.length) 

for(i=0; i < Area.length; i++) 

HideAll(Area[i],0); 
Temp = eval("E_"+Area[i]); 
Temp.style.display="none"; 
Temp = eval("P_"+Area[i]); 
Temp.className="out"; 



document.onmouseup=OnMouseUp; 
document.onclick=OnClick; 
function OnMouseUp() 

if(window.event.button == 2) 

var PopMenu; 
PopMenu = eval("E_rbpm"); 
HideAll("rbpm",0); 
PopMenu.style.display="block"; 
PopMenu.style.posLeft=document.body.scrollLeft+window.event.clientX; 
PopMenu.style.posTop=document.body.scrollTop+window.event.clientY; 
if(PopMenu.style.posLeft+PopMenu.offsetWidth > document.body.scrollLeft+document.body.clientWidth) 
PopMenu.style.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth; 
if(PopMenu.style.posLeft < 0) PopMenu.style.posLeft=0; 
if(PopMenu.style.posTop+PopMenu.offsetHeight > document.body.scrollTop+document.body.clientHeight) 
PopMenu.style.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight; 
if(PopMenu.style.posTop < 0) PopMenu.style.posTop=0; 


function OnClick() 

HideAll("rbpm",0); 

// Add Your Function on following 
function Do_viewcode(){window.location="view-source:"+window.location.href;} 
function Do_help(){window.showHelp(window.location);} 
function Do_exit() {window.close();} 
function Do_refresh() {window.location.reload();} 
function Do_back() {history.back();} 
function Do_forward() {history.forward();} 
function Do_help(){ 
var s_help='<style>body,td{font:menu;padding:2}</style>'; 
s_help+='<title>帮助</title>'; 
s_help+='<body bgcolor=menu>'; 
s_help+='<br> 欢迎光临无忧视窗!本系统和您的Windows系统操作很相似。单击开始,打开开始菜单,双击桌面图标打开相关文件!<span style="color:blue;cursor:hand" onclick=showHelp("windows.chm::/MS-ITS:ntdef.chm::/default.htm")>本机帮助..</span>'; 
showModalDialog("about:"+s_help+"","","dialogHeight:110px;dialogWidth:210px;help:yes;status:no")} 
--> 
</SCRIPT> 
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD> 
<BODY oncontextmenu=window.event.returnValue=false> 
<img src="aa.jpg" alt="点右键">
<img src="bb.jpg" alt="点右键">
<img src="cc.jpg" alt="点右键"><br>
<br><SCRIPT language=JScript> 
<!-- 
var menu = new RightMenu(); 
menu.AddItem("update","start_update","4","<font class=w2kfont>Web Update</font>","rbpm","http://"); 
menu.AddItem("suan","suan","a","大蒜之乡","rbpm","http://"); 
menu.AddItem("sperator","","","","rbpm",null); 
menu.AddExtendMenu("program","start_pro","24","程序<font class=w2kfont>(<u>P</u>)</font>","rbpm",null); 
menu.AddExtendMenu("p_acc","folder","+","附件","program",null); 
menu.AddItem("p_acc1","html","+","<font class=w2kfont>Microsoft FrontPage 2000</font>","program","51w/game/"); 
menu.AddItem("p_acc2","html","+","<font class=w2kfont>Norton AntiVirus Corporate Edition</font>","program","http://"); 
menu.AddExtendMenu("p_lgame","folder","16","小游戏","p_acc",null); 
menu.AddItem("p_game1","folder","+","扫雷","p_lgame","51w/game/"); 
menu.AddItem("p_game2","folder","+","超级玛力","p_lgame","51w/game/"); 
menu.AddItem("p_game3","folder","+","五子棋","p_lgame","51w/game/"); 
menu.AddItem("p_game4","folder","+","俄罗斯方块","p_lgame","51w/game/"); 
menu.AddExtendMenu("doc","start_doc","24","文档<font class=w2kfont>(<u>D</u>)</font>","rbpm",null); 
menu.AddItem("d_photo","folder","+","我的邮票","doc",null); 
menu.AddExtendMenu("fav","start_fav","24","收藏<font class=w2kfont>(<u>A</u>)</font>","rbpm",null); 
menu.AddExtendMenu("f_bbs","folder","16","论坛","fav",null); 
menu.AddItem("f_bbs1","html","+","蓝色理想","f_bbs","http://www.blueidea.com/bbs/"); 
menu.AddItem("f_bbs2","html","+","无忧脚本","f_bbs","http://www.51js.com/"); 
menu.AddItem("f_bbs3","html","+","CSDN专家门诊","f_bbs","http://www.csdn.net/Expert/"); 
menu.AddItem("f_bbs4","html","+","洪恩在线网上交流","f_bbs","http://"); 
menu.AddExtendMenu("f_webpage","folder","16","网页制作","fav",null); 
menu.AddItem("f_webpage1","html","","<font disabled>(空)</font>","f_webpage","http://"); 
menu.AddExtendMenu("f_study","folder","16","网上学习","fav",null); 
menu.AddItem("f_s1","html","","<font disabled>(空)</font>","f_study","http://matrix.hongen.com/forum/"); 
menu.AddExtendMenu("f_link","folder","16","友情链接","fav",null); 
menu.AddItem("f_link1","html","+","无忧视窗","f_link","http://www.51windows.com"); 
menu.AddExtendMenu("setting","start_set","24","设置<font class=w2kfont>(<u>S</u>)</font>","rbpm",null); 
menu.AddItem("s_panel","folder","+","控制面板(C)","setting","http://"); 
menu.AddItem("sperator","","","","setting",null); 
menu.AddItem("s_data","s_user","+","用户资料(D)","setting","http://"); 
menu.AddItem("s_display1","s_taskbar","+","任务栏和开始菜单(T)","setting","http://"); 
menu.AddExtendMenu("find","start_find","24","查找<font class=w2kfont>(<u>F</u>)","rbpm",null); 
menu.AddItem("l_search","search","4","文件或文件夹上(<u>F</u>)...","find","http://"); 
menu.AddItem("i_search","esearch","4","在Internet上(<u>I</u>)...","find","http://"); 
menu.AddItem("u_search","f_user","4","用户(<u>P</u>)...","find","http://"); 
menu.AddItem("help","start_help","V"," 帮助<font class=w2kfont>(<u>H</u>)</font>","rbpm",null); 
menu.AddItem("sperator","","","","rbpm",null); 
menu.AddItem("logoff","start_logoff","v"," 注销<font class=w2kfont>(<u>L</u>)</font>","rbpm",null); 
menu.AddItem("shut","start_shut","x","退出<font class=w2kfont>(<u>U</u>)</font>","rbpm",null); 
document.writeln(menu.GetMenu()); 
--> 
</SCRIPT> 
</TD></TR></TABLE>

解决方案 »

  1.   

    太长了,没耐心看,不过给你点提示吧:
    1、既然只要图片的,可以在图片的代码标签中加入一个js,作用是让图片右击的时候调用这个js
    2、不要在让这个js成为页面默认的右击,就是关闭掉系统默认的加载希望有帮助。
      

  2.   

    这么简单的...................,测试过了..........
    给分给xiaolei1982吧,有一个帖子楼主不知道怎么分都给我了function OnMouseUp() 

    //================================这里加个是否是img的判断================================
    if(window.event.button == 2&&event.srcElement.tagName=="IMG") { 
    var PopMenu; 
    PopMenu = eval("E_rbpm"); 
    HideAll("rbpm",0); 
    PopMenu.style.display="block"; 
    PopMenu.style.posLeft=document.body.scrollLeft+window.event.clientX; 
    PopMenu.style.posTop=document.body.scrollTop+window.event.clientY; 
    if(PopMenu.style.posLeft+PopMenu.offsetWidth > document.body.scrollLeft+document.body.clientWidth) 
    PopMenu.style.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth; 
    if(PopMenu.style.posLeft < 0) PopMenu.style.posLeft=0; 
    if(PopMenu.style.posTop+PopMenu.offsetHeight > document.body.scrollTop+document.body.clientHeight) 
    PopMenu.style.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight; 
    if(PopMenu.style.posTop < 0) PopMenu.style.posTop=0; 

      

  3.   

    吃野去.............就是代码多吓人而已,其实就改一个处理函数document.onmouseup=OnMouseUp 
      

  4.   

    哈哈,,我已经解决了,,大概思路也是这样的谢谢 showbo了,呵,,哎,这分应该给谁呢,,真想给我自己,,哈哈哈,,,
      

  5.   

    刚才忙家务去了,忙年啊,哈哈,就冲showbo这句话,心领了,心意到了就行,
    楼主也别为难了,谁给你解决了就给谁,偶心理已经很高兴了
      

  6.   

    区区一个右建菜单有这么麻烦吗?
    代码简单易懂http://blog.csdn.net/zhulei2008/archive/2007/08/11/1737805.aspx分还是给我吧,哈哈
      

  7.   

    昨天没仔细看要求,忘记一点了......系统的菜单//把                 <BODY oncontextmenu=window.event.returnValue=false> 
    //变为============><BODY oncontextmenu="HandlerSystemMenu()">
    //处理系统菜单显示的函数
    function HandlerSystemMenu()
    {
      if(event.srcElement.tagName=="IMG")//是否在图片上点右键,是的话把系统菜单禁止
        event.returnValue=false
    }
    function OnMouseUp() 

    if(window.event.button == 2&&event.srcElement.tagName=="IMG") //是否在图片上点右键

    var PopMenu; 
    PopMenu = eval("E_rbpm"); 
    HideAll("rbpm",0); 
    PopMenu.style.display="block"; 
    PopMenu.style.posLeft=document.body.scrollLeft+window.event.clientX; 
    PopMenu.style.posTop=document.body.scrollTop+window.event.clientY; 
    if(PopMenu.style.posLeft+PopMenu.offsetWidth > document.body.scrollLeft+document.body.clientWidth) 
    PopMenu.style.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth; 
    if(PopMenu.style.posLeft < 0) PopMenu.style.posLeft=0; 
    if(PopMenu.style.posTop+PopMenu.offsetHeight > document.body.scrollTop+document.body.clientHeight) 
    PopMenu.style.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight; 
    if(PopMenu.style.posTop < 0) PopMenu.style.posTop=0;