-
Dtree is an easy-to-use JavaScript Tree Menu Control
-
Support Unlimited ratings, you can place multiple on the same page Dtree , you can specify a different icon for each node.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/76/F9/wKiom1Zf7UzR5xtBAAAe5UCKrWE455.jpg "title=" 1.jpg " alt= "Wkiom1zf7uzr5xtbaaae5uckrwe455.jpg"/>
How to use:
-
introduced Dtree.css style
-
introduced Dtree.js script File
<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, ' The trip to iceland ', ' example01.html ', ' Pictures of gullfoss and geysir '); d.add (11,9, ' mom\ ' s birthday ', ' example01.html '); d.add (12,0, ' recycle bin ', ' Example01.html ', ', ', ' img/trash.gif '); document.write (d); //--> </script>
Parameter description:
| name
|
|
|
|
Id |
Number |
the only ID number |
|
Pid |
Number |
determine the number of the parent node , the value of the root node is -1 |
|
Name |
String |
text label of the node |
|
url
|
string
|
node url |
|
title
|
string |
node title |
|
Target |
String |
node's Target |
|
Icon |
String |
Icons for Nodes , The default value is used when the node does not specify an icon |
|
Iconopen |
String |
icon to be used as a node open , The default value is used when the node does not specify an icon |
|
open
|
boolean
|
Determine if the node is open |
This article is from the "Lao Niu Java" blog, please be sure to keep this source http://liuyj.blog.51cto.com/2340749/1719249
Dtree JS Basic Usage