补充: 我用的是asp.net开发的 在web页面里加入  请大家帮忙了 谢谢了

解决方案 »

  1.   

    不关asp.net事,
    写了一个给你,<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language="JavaScript">
    function show_menu()
    {
    var d=document.getElementById("d1");
    if(event.button==2)
    {
    d.style.display="";
    d.style.top=event.y;
    d.style.left=event.x;
    }
    else
    {
    d.style.display="none";
    }
    }
    </script></head><body onmousedown="show_menu()" oncontextmenu="return   false">
    <div id="d1" style="width:100px;height:150px;float:left;top:100px;position:absolute ; background-color:#eeeeff;display:none">
    <li>AAAAAAAA</li>
    <li>BBBBBBBb</li>
    <li>CCCCCCCC</li>
    <li>DDDDDDDD</li>
    </div>
    </body>
    </html>
      

  2.   

    贡献一个,项目中在用的这个DIV效果不是很好
    // JavaScript Document
    var  display_url=0;
    function document.detailForm.onmouseup(){if(event.button==2)showMenu()}
    function showMenu()
    {//显示菜单,调整菜单位置
    var rightedge=document.body.clientWidth-event.clientX;
    var bottomedge=document.body.clientHeight-event.clientY;
    if(rightedge<menu_div.offsetWidth)
       menu_div.style.left=document.body.scrollLeft+event.clientX-menu_div.offsetWidth;
    else
       menu_div.style.left=document.body.scrollLeft+event.clientX;
    if(bottomedge<menu_div.offsetHeight)
       menu_div.style.top=document.body.scrollTop+event.clientY-menu_div.offsetHeight;
    else
       menu_div.style.top=document.body.scrollTop+event.clientY;
    menu_div.style.visibility="visible";
    }
    function hideMenu()
    {//隐藏菜单
    menu_div.style.visibility="hidden";
    }
    function highLightMenuItem()
    {//高亮显示当前菜单项
    if(event.srcElement.className!="menuitem")return;
    event.srcElement.style.backgroudColor="highlight";
    event.srcElement.style.color="white";
    display_url=event.srcElement.url;
    window.status=display_url;
    }
    function lowlightMenuItem()
    {//非当前菜单项显示为普通格式
    if(event.srcElement.className!="menuitem")return;
    event.srcElement.style.backgroudColor="menu";
    event.srcElement.style.color="black";
    window.status="";
    }
    function jumpTo()
    {//当选中某个菜单项时,则打开对应页面
       if(event.srcElement.className!="menuitem")return;
       if(event.srcElement.getAttribute("target")!=null)
       window.open(event.srcElement.url.event.srcElement.getAttribute("target"));
       else
       window.location=event.srcElement.url;

    } <DIV  id="menu_div" onMouseover="highLightMenuItem()" onMouseout="lowlightMenuItem()"  onclick="jumpTo();">
    <div class="menuitem" style=" text-align:center"><a style=" text-decoration:underline" onClick="window.open();">新&nbsp;建</a></div><br>
    <div class="menuitem" style=" text-align:center"><a style=" text-decoration:underline" onClick="window.open();">修&nbsp;改</a></div><br>
    <div class="menuitem" style=" text-align:center"><a style=" text-decoration:underline" onClick="return confirm('确认删除吗?')" >删&nbsp;除</a></div><br>
    <div class="menuitem" style=" text-align:center"><a style=" text-decoration:underline" onClick="window.open();">查&nbsp;询</a></div>
    <script language="JavaScript1.2">  if (document.all && window.print) {//document.oncontextmenu = showmenuie5;
             document.body.onclick = hideMenu;}
    </script>
      

  3.   

    <script type="text/javascript">
    function Tad(){
    var tables = document.getElementsByTagName("table");
       
    for(var i=1;i<tables[0].rows.length;i++){
    alert(tables[0].rows[i].cells[1].firstChild.nodeValue);
      }
    }


    </script>
      

  4.   

    http://www.stdingan.com:8080/js/popMenu.htm