小弟正在用PHP开发一个小系统,环境是UBUNTU+APACHE2+PHP5+MYSQL5+ADODB。想对一个树状列表设置右键菜单,但不知道用什么技术,请教各位前辈,还望指明方向。
希望是轻巧快捷的开发方法,暂不要求右键菜单有多好看。

解决方案 »

  1.   

    JavaScript右键,参考下面的
    http://www.pconline.com.cn/pcedu/empolder/wz/javascript/10202/37254.html
      

  2.   

    //右击菜单
    var mname=new Array(
    "复制",
    "剪贴",
    "粘贴",
    "删除",
    "还原"
    );
    //mname是菜单对应的名称,数组的个数必须与下面murl对应function cut(0)
    {
        alert('复制事件');
    }function cut(1)
    {
        alert('剪贴事件');
    }function paste()
    {
        alert('粘贴事件');
    }function del()
    {
        alert('删除事件');
    }function restore()
    {
        alert('还原事件');
    }var murl=new Array(
    "cut(0);showoff()",
    "cut(1);showoff()",
    "paste();showoff()",
    "del();showoff()",
    "restore();showoff()"
    );var bgc="#eaeaea",txc="#9a9a9a";                                               
      //菜单没有选中的背景色和文字色
    var cbgc="#85c024",ctxc="white";                                            
      //菜单选中的选项背景色和文字色var mover="this.style.background='"+cbgc+"';this.style.color='"+ctxc+"';"
    var mout="this.style.background='"+bgc+"';this.style.color='"+txc+"';"
    var mlay = document.getElementById("mlay");document.getElementById("record").oncontextmenu=function(event)

    var event = (event==null) ? window.event : event;
    mlay.style.display="";
    $("#mlay").css("top", event.clientY);
    $("#mlay").css("left", event.clientX);
    return false;
    }function showoff()
    {
     mlay.style.display="none";
    }function fresh()
    {
    mlay.style.background=bgc;
    mlay.style.color=txc;
    $("#mlay").css("border-left",'5px solid #bcbcbc');
    mlay.style.width='70px';
    mlay.style.height='125px';
    var h="<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>";
      var i=0;
    for(i=0;i<mname.length;i++)
    {
    h+="<tr align=center  onclick=\""+murl[i]+"\" onMouseover=\""+mover+"\" onMouseout=\""+mout+"\"><td style='font-size:9pt;'>"+mname[i]+"</td></tr>";
    }
    h+="</table>";
    mlay.innerHTML=h;
    }
    我正在使用《Csdn收音机》第一时间获取最新动态!
      

  3.   

    大家都支持JS,看来主流的技术就是JS了。
    万分感谢
      

  4.   

    http://www.lanrentuku.com/js/daohang-548.html右键菜单,预览地址:http://d.lanrentuku.com/down/js/daohang-548/基于Prototype 框架,也是JS。里面基本都写了,看看代码不难,自己添加行为事件就完了
      

  5.   

    用的是csdn收音机 软件登录csdn我正在使用《Csdn收音机》第一时间获取最新动态!