Download and use of dtree and use of dtree

Source: Internet
Author: User

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:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.