http://expert.csdn.net/Expert/topic/1986/1986285.xml?temp=.9895288http://fason.nease.net/zhuanti/tree/deeptree.rar

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1986/1986285.xml?temp=.9895288http://fason.nease.net/zhuanti/tree/deeptree.rar
      

  2.   

    var mimgpath="treeimg";
    var mfonts="style=\"text-decoration:none;font-family: 宋体; font-size: 9pt; color: #000000; \"";
    var movercolor="#0000FF";
    var mnormalcolor="#000000";
    var NC6=(navigator.userAgent.indexOf("Netscape6")>0)?true:false;
    var IE=(document.all)?true:false;
    function mOver(id) {
    if (IE) {eval(id).style.color=movercolor; } 
    else if(NC6){ document.getElementById(id).style.color=movercolor;}
    }
    function mOut(id) {
    if (IE) {eval(id).style.color=mnormalcolor; } 
    else if(NC6){ document.getElementById(id).style.color=mnormalcolor;}
    }function mFolderExpand($1,$2,pic) {
    if (IE) { mExpandIE($1,$2,pic) } 
    else if(NC6){ mExpandNC($1,$2,pic) }
    }function mExpandIE($1,$2,pic) {
    Expanda = eval($1 + "a");
    Expanda.blur()
    ExpandChild = eval($1 + "Child");
        if ($2 != "top") { 
    ExpandTree = eval($1 + "Tree");
    //ExpandFolder = eval($1 + "Folder");
    }
    if (ExpandChild.style.display == "none") {
    ExpandChild.style.display = "block";
            if ($2 != "top") { 
                if ($2 == "last") { ExpandTree.src = mimgpath+"/Lminus.gif"; }
    else { ExpandTree.src = mimgpath+"/Tminus.gif"; }
    //ExpandFolder.src = mimgpath+"/openfolder"+pic+".gif";
    }
    else { mmTree.src = mimgpath+"/topopen1.gif"; }
    }else{
    ExpandChild.style.display = "none";
            if ($2 != "top") { 
            if ($2 == "last") { ExpandTree.src = mimgpath+"/Lplus.gif"; }
    else { ExpandTree.src = mimgpath+"/Tplus.gif"; }
    //ExpandFolder.src = mimgpath+"/folder"+pic+".gif";
    }
    else { mmTree.src = mimgpath+"/top1.gif"; }
    }
    }
    function mExpandNC($1,$2,pic) {
    Expanda = document.getElementById($1 + "a");
    Expanda.blur()
    ExpandChild = document.getElementById($1 + "Child");
        if ($2 != "top") { 
    ExpandTree = document.getElementById($1 + "Tree");
    //ExpandFolder = document.getElementById($1 + "Folder");
    }
    if (ExpandChild.style.display == "none") {
    ExpandChild.style.display = "block";
            if ($2 != "top") { 
                if ($2 == "last") { ExpandTree.src = mimgpath+"/Lminus.gif"; }
    else { ExpandTree.src = mimgpath+"/Tminus.gif"; }
    //ExpandFolder.src = mimgpath+"/openfolder"+pic+".gif";
    }
    else { document.getElementById("mmTree").src = mimgpath+"/topopen1.gif"; }
    }else{
    ExpandChild.style.display = "none";
            if ($2 != "top") { 
            if ($2 == "last") { ExpandTree.src = mimgpath+"/Lplus.gif"; }
    else { ExpandTree.src = mimgpath+"/Tplus.gif"; }
    //ExpandFolder.src = mimgpath+"/folder"+pic+".gif";
    }
    else {document.getElementById("mmTree").src = mimgpath+"/top1.gif"; }
    }
    }
    with(document){
    write("<div ID=\"mmParent\"><a ID=\"mma\" href=\"#\" style=\"text-decoration:none;font-family: 宋体; font-size: 9pt; color: #000000; \" onClick=\"mFolderExpand('mm','top',null)\">");
    write("<img ID=\"mmTree\" src=\""+mimgpath+"/topopen1.gif\" style=\"margin-right: 5\" align=\"absmiddle\" border=\"0\">");
    write("<font ID=\"mTitle0\" onmouseover=\"mOver('mTitle0')\" onmouseout=\"mOut('mTitle0')\"></font></a></div>");
    write("<div ID=\"mmChild\"><div ID=\"mm1Parent\"><a ID=\"mm1a\" target=\"_self\" href=\"#\" "+mfonts+" onClick=\"mFolderExpand('mm1',null,'4')\" title=\"\">");
    write("<img ID=\"mm1Tree\" src=\""+mimgpath+"/Tplus.gif\" align=\"absmiddle\" border=\"0\"><font ID=\"mTitle1\" onmouseover=\"mOver('mTitle1')\" onmouseout=\"mOut('mTitle1')\">文件</font></a>");
    write("</div>");
    write("<div ID=\"mm1Child\" style=\"display:none;\">");
    write("<div ID=\"mm2Parent\"><a ID=\"mm2a\" target=\"_self\" href=\"#\" "+mfonts+" onClick=\"mFolderExpand('mm2',null,'0')\" title=\"\">");
    write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img ID=\"mm2Tree\" src=\""+mimgpath+"/Tplus.gif\" align=\"absmiddle\" border=\"0\"><font ID=\"mTitle2\" onmouseover=\"mOver('mTitle2')\" onmouseout=\"mOut('mTitle2')\">新建</font></a>");
    write("</div>");
    write("<div ID=\"mm2Child\" style=\"display:none;\">");
    write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/L.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><a target=\"mainFrame\" href=\"main.htm\" "+mfonts+" title=\"\"><font ID=\"mTitle3\" onmouseover=\"mOver('mTitle3')\" onmouseout=\"mOut('mTitle3')\">新建文件</font></a><br>");
    write("</div>");
    write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/L.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><a target=\"mainFrame\" href=\"main1.htm\" "+mfonts+" title=\"\"><font ID=\"mTitle4\" onmouseover=\"mOver('mTitle4')\" onmouseout=\"mOut('mTitle4')\">新建菜单</font></a><br>");
    write("</div>");
    write("<img src=\""+mimgpath+"/L.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle5\" onmouseover=\"mOver('mTitle5')\" onmouseout=\"mOut('mTitle5')\">系统</font></a><br>");
    write("</div>");
    }
    这是用webmenushop做的
    调用时只要在相应的页面上写上<script language="javascript" src="menu.js"></script>就可以了,当然还需要“+”号的图片
      

  3.   

    忘记了,前面的程序应该放在以menu.js为名字的文件中