The following is a layer-4 directory tree that is expanded step by step. The data in the directory tree is obtained from a very large XML file with the same structure. When the page is opened, obtain the data of the first two layers. When you click a list item, you can obtain the data of the next two layers (lower and lower layers because the data is obtained at the beginning of the next layer) of the list item in real time.
----------------------
From http://bbs.blueidea.com/viewthread.php? Tid = 2676250
======================================
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Style type = "text/CSS">
Ul {
Font-size: 12px;
}
Li {
Cursor: pointer;
}
</Style>
<Title> category display </title>
</Head>
<Body>
<Div>
<Div>
<Div>
<Ul id = "layerunspsc1">
<Li> layer-3 Node
<Ul>
<Li> layer-3 Node
<Ul>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
</Ul>
</LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 Node
<Ul>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
<Li> layer-3 Node
<Ul>
<Li> layer-3 node </LI>
<Li> layer-3 node </LI>
</Ul>
</LI>
</Ul>
</LI>
</Ul>
</LI>
</Ul>
</Div>
</Div>
</Div>
<SCRIPT type = "text/JavaScript">
VaR layerunspsc1 = Document. getelementbyid ("layerunspsc1 ");
VaR layerunspsc1_li = layerunspsc1.getelementsbytagname ("Li ");
For (VAR I = 0; I <layerunspsc1_li.length; I ++ ){
For (var j = 0; j <layerunspsc1_li [I]. childnodes. length; j ++ ){
VaR ul = layerunspsc1_li [I]. childnodes [J];
If (UL. nodename = "Ul "){
Ul. style. Display = "NONE ";
}
}
}
Layerunspsc1.onclick = function (NAV ){
VaR li = (document. All )? Event. srcelement: nav.tar get;
If (Li. nodename = "Li "){
For (VAR a = 0; A <li. childnodes. length; A ++ ){
VaR ul = Li. childnodes [a];
If (UL. nodename = "Ul "){
Ul. style. Display = (UL. style. Display = "NONE ")? "": "NONE ";
}
}
}
}
</SCRIPT>
</Body>
</Html>