JS 트리구조 메뉴
인터넷정보2007. 10. 11. 14:26
http://www.destroydrop.com/javascripts/tree/
Key features
- Unlimited number of levels
- Can be used with or without frames
- Remembers the state of the tree between pages
- Possible to have as many trees as you like on a page
- All major browsers suported
- Internet Explorer 5+
- Netscape 6+
- Opera 7+
- Mozilla
- Generates XHTML 1.0 strict validated output
- Alternative images for each node
dtree.js
example01.html
Destroydrop » Javascripts » Tree » Api
Overview
Functions
add()
Adds a node to the tree.
Can only be called before the tree is drawn.
id, pid and name are required.
Parameters
Name | Type | Description |
---|---|---|
id | Number | Unique identity number. |
pid | Number | Number refering to the parent node. The value for the root node has to be -1. |
name | String | Text label for the node. |
url | String | Url for the node. |
title | String | Title for the node. |
target | String | Target for the node. |
icon | String | Image file to use as the icon. Uses default if not specified. |
iconOpen | String | Image file to use as the open icon. Uses default if not specified. |
open | Boolean | Is the node open. |
Example
mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');
openAll()
Opens all the nodes.
Can be called before and after the tree is drawn.
Example
mytree.openAll();
closeAll()
Closes all the nodes.
Can be called before and after the tree is drawn.
Example
mytree.closeAll();
openTo()
Opens the tree to a certain node and can also select the node.
Can only be called after the tree is drawn.
Parameters
Name | Type | Description |
---|---|---|
id | Number | Identity number for the node. |
select | Boolean | Should the node be selected. |
Example
mytree.openTo(4, true);
Configuration
Variable | Type | Default | Description |
---|---|---|---|
target | String | true | Target for all the nodes. |
folderLinks | Boolean | true | Should folders be links. |
useSelection | Boolean | true | Nodes can be selected(highlighted). |
useCookies | Boolean | true | The tree uses cookies to rember it's state. |
useLines | Boolean | true | Tree is drawn with lines. |
useIcons | Boolean | true | Tree is drawn with icons. |
useStatusText | Boolean | false | Displays node names in the statusbar instead of the url. |
closeSameLevel | Boolean | false | Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled. |
inOrder | Boolean | false | If parent nodes are always added before children, setting this to true speeds up the tree. |
Example
mytree.config.target = "mytarget";
'인터넷정보' 카테고리의 다른 글
롤링 배너용 js(class 형식) (0) | 2007.10.11 |
---|---|
try{...} catch(e){...} 구문 , e.number,e.description (0) | 2007.10.11 |
문자열 바이트 길이알기, 바이트만큼 자르기 (0) | 2007.10.11 |
API를 모와둔 사이트 gotapi.com (0) | 2007.10.11 |
PNG24 반투명 지원법 (IE용) (0) | 2007.10.11 |
select 용 함수 모음 (0) | 2007.10.11 |
UTF-8로 바꾸는 법, 문자열 인코딩 바꾸기 (0) | 2007.10.11 |
IE7의 변경(오류,버그,바뀐점) (0) | 2007.10.11 |
이미지 없이 라운딩 박스 표현하기1 (0) | 2007.10.11 |
주민/외국인 등록번호 (0) | 2007.10.11 |