接上面代码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.   

    接上面代码
    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>
      

  2.   

    到底还是来这里求代码了,哈~
    不过自己动了脑筋就好;
    你贴的代码我没仔细看;把我在你上个帖子里的内容帮你改成了一级菜单:<HTML>
    <HEAD>
    <TITLE>右键菜单</TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><SCRIPT LANGUAGE="JScript">
    var pops = new Array();
    function CreatePopup(degree)
    {
        if (degree < 0)
            return null;
        if (pops[degree] != null)
            return pops[degree];    if (degree == 0)
            pops[0] = window.createPopup(); 
        else{
            if (pops[degree - 1] == null)
                pops[degree - 1] = CreatePopup(degree - 1)
            pops[degree] = pops[degree - 1].document.parentWindow.createPopup();
        }
        pops[degree].document.body.setAttribute("degree", degree);
        return pops[degree];
    }CreatePopup(1);
    //Creating the popup window object
    var oPopup = pops[0];
    var timer = null;
    function ContextMenu()
    {
        var lefter = event.y+5;
        var topper = event.x+5;
        oPopup.document.body.innerHTML =oContextHTML.innerHTML; 
        oPopup.show(topper, lefter, 200, 65, document.body);
    }</SCRIPT></HEAD><BODY onmousemove="window.status = window.event.x + '/'+ window.event.y"><br><br><br><br><br><br><br><br>
    <img id=a src='aaa.gif' alt='点右键'  onContextMenu="ContextMenu(); return false;">
    <img id=b src='bbb.gif' alt='点右键'  onContextMenu="ContextMenu(); return false;">
    <img id=c src='ccc.gif' alt='点右键'  onContextMenu="ContextMenu(); return false;"><DIV ID="oContextHTML" STYLE="display:none;">
        <DIV onmouseover="this.style.background='gold';" 
             onmouseout="this.style.background='#fff9ff';" 
             STYLE="font-family:verdana; font-size:70%; height:30px; background:#fff9ff; border:1px solid black; padding:4px; cursor:hand ">
        <SPAN ONCLICK="">
        菜单1</SPAN> 
        </DIV>
        <DIV onmouseover="this.style.background='gold';" 
             onmouseout="this.style.background='#fff9ff';" 
             STYLE="font-family:verdana; font-size:70%; height:30px; background:#fff9ff; border:1px solid black; padding:4px; cursor:hand; border-top:0px solid black">
        <SPAN ONCLICK="">
        菜单2</SPAN> 
        </DIV>
    </DIV></BODY>
    </HTML>
      

  3.   

    哈哈,,终于解决了,,头晕了一下午了,呵,,,谢谢 toury 和各位了,又被你发现了。。:)