Download and use of dtree and use of dtree
Dtree is a tree menu component written in JavaScript. It is free and open-source.
Dtree has the following advantages:
-Unlimited number of levels (Unlimited classification)-Can be used with or without frames (applicable to frame or non-frame pages) -Remembers the state of the tree between pages (the current state can be remembered between different pages) -Possible to have as your trees as you like on a page (you can get the desired number of trees)-All major browsers suported (supported browsers) internet Explorer 5 + Netscape 6 + Opera 7 + Mozilla-Generates XHTML 1.0 strict validated output (strong support for XHTML 1.0)-Alternative images for each node (each node is replaced by an image)
Dtree:
Http://www.destroydrop.com/javascripts/tree/
Download dtree.zip and unzip the directory as follows:
Img Folder: The image icon api.html: dtreehelper document dtree.css: tree menu style dtree. js: The js Code is in the example01.html: tree menu instance.
File to be referenced
<Link rel = "StyleSheet" href = "dtree.css" type = "text/css"/>
<Script type = "text/javascript" src = "dtree. js"> </script>
Example:
<Div class = "dtree">
<P> <a href = "javascript: d. openAll (); "> open all </a> | <a href =" javascript: d. closeAll (); "> close all </a> </p>
<Script type = "text/javascript">
<! --
D = new dTree ('D ');
D. add (0,-1, 'My example tree ');
D. add (1, 0, 'node 1', 'example01.html ');
D. add (2, 0, 'node 2', 'example01.html ');
D. add (3,1, 'node 1.1', 'example01.html ');
D. add (4,0, 'node 3', 'example01.html ');
D. add (5, 3, 'node 1.1.1', 'example01.html ');
D. add (6, 5, 'node 1.1.1.1', 'example01.html ');
D. add (7,0, 'node 4', 'example01.html ');
D. add (8, 1, 'node 1.2', 'example01.html ');
D. add (9, 0, 'My Pictures', 'example01.html ', 'pictures I \' ve taken over the years', '','', 'img/imgfolder.gif ');
D. add (10, 9, 'trip to iceland', 'example01.html ', 'pictures of Gullfoss and Geysir ');
D. add (11,9, 'Mom \'s birthday', 'example01.html ');
D. add (, 'recycle bin', 'example01.html ', '','', 'img/trash.gif ');
Document. write (d );
// -->
</Script>
</Div>
The running effect is as follows: