seehttp://www.xtreeme.com/sitexpert/styles/index.php

解决方案 »

  1.   

    我最近自己写的,目前只有3层,后台是xml和access,html component
    http://www24.brinkster.com/genie517/Products/menu.html
      

  2.   

    我想用xml,c#怎么实现啊?
      

  3.   

    下面是用javascript实现的树:希望对你有所帮助
    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/hi.asp" -->
    <%
    set Recordset2 = Server.CreateObject("ADODB.Recordset")
    Recordset2.ActiveConnection = MM_hi_STRING
    Recordset2.Source = "SELECT * FROM sxlt"
    Recordset2.CursorType = 0
    Recordset2.CursorLocation = 2
    Recordset2.LockType = 3
    Recordset2.Open()
    Recordset2_numRows = 0
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="shu.css" type="text/css">
    </head>
    <body bgcolor="#FFFFFF" text="#000000" class="unnamed1">
    <script language="JavaScript">
    NS4 = (document.layers) ? 1 : 0;
    IE4 = (document.all) ? 1 : 0;
    ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) {
        with (document) {
            write("<STYLE TYPE='text/css'>");
            if (NS4) {
                write(".parent {position:absolute; visibility:visible}");
                write(".child {position:absolute; visibility:visible}");
                write(".regular {position:absolute; visibility:visible}")
            }
            else {
                write(".child {display:none}")
            }
            write("</STYLE>");
        }
    }function getIndex(el) {
        ind = null;
        for (i=0; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.id == el) {
                ind = i;
                break;
            }
        }
        return ind;
    }function arrange() {
        nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
        for (i=firstInd+1; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.visibility != "hide") {
                whichEl.pageY = nextY;
                nextY += whichEl.document.height;
            }
        }
    }function initIt(){
        if (!ver4) return;
        if (NS4) {
            for (i=0; i<document.layers.length; i++) {
                whichEl = document.layers[i];
                if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
           }
            arrange();
        }
        else {
            divColl = document.all.tags("DIV");
            for (i=0; i<divColl.length; i++) {
                whichEl = divColl(i);
                if (whichEl.className == "child") whichEl.style.display = "none";
            }
        }
    }function expandIt(el) {
        if (!ver4) return;
        if (IE4) {
            whichEl = eval(el + "Child");
            if (whichEl.style.display == "none") {
                whichEl.style.display = "block";
            }
            else {
                whichEl.style.display = "none";
            }
        }
        else {
            whichEl = eval("document." + el + "Child");
            if (whichEl.visibility == "hide") {
                whichEl.visibility = "show";
            }
            else {
                whichEl.visibility = "hide";
            }
            arrange();
        }
    }
    onload = initIt;
    </script>
    <% 
    DO While NOT Recordset2.EOF
    iidd = (Recordset2.Fields.Item("sxltid").Value)
    %>
    <div id="KB<%=(Recordset2.Fields.Item("sxltid").Value)%>Parent" class="parent"><a href="#" onClick="expandIt('KB<%=(Recordset2.Fields.Item("sxltid").Value)%>'); return false" ><img src="pic/plus.gif" border=0 width="35" height="17"><%=(Recordset2.Fields.Item("sxltsubject").Value)%></a></div>
    <div id="KB<%=(Recordset2.Fields.Item("sxltid").Value)%>Child" class="child"> 
    <%
    set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_hi_STRING
    Recordset1.Source = "SELECT * FROM sxb WHERE sxfatherid = "& iidd &""
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 3
    Recordset1.Open()
    Recordset1_numRows = 0
    DO While NOT Recordset1.EOF
    response.write "<a href='default.asp?sxid="& Recordset1.Fields.Item("sxid").Value &"' target='_blank' ><img src='pic/spacer.gif'  border=0 alt='' width='15' height='11'><img src='pic/open.gif'  border='0' width='32' height='18'>"& Recordset1.Fields.Item("sxsubject").Value &"</a><br>"
    Recordset1.MoveNext()
    loop
    %>
    </div> 
    <%
    Recordset2.MoveNext()
    loop
    %>
    </body>
    </html>
    <%
    Recordset1.Close()
    %>
    <%
    Recordset2.Close()
    %>
      

  4.   

    我把微软的TreeView给写出来了!行不行?要源码的话!说一声!
      

  5.   

    qieyj(温馨港湾) 精神可嘉,都给你了。