Dtree JS Basic Usage

Source: Internet
Author: User

    • 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:

    1. introduced Dtree.css style

    2. 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

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.