https://github.com/pioz/jquery-tree
jQuery-tree is a jQuery plugin to make an HTML unorder list (ul) in a tree.
https://github.com/pioz/jquery-tree
javascript jquery-plugin tree
Last synced: over 1 year ago
JSON representation
jQuery-tree is a jQuery plugin to make an HTML unorder list (ul) in a tree.
- Host: GitHub
- URL: https://github.com/pioz/jquery-tree
- Owner: pioz
- License: lgpl-3.0
- Created: 2011-02-22T15:38:25.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2014-04-28T17:51:08.000Z (about 12 years ago)
- Last Synced: 2023-04-10T15:53:50.510Z (about 3 years ago)
- Topics: javascript, jquery-plugin, tree
- Language: JavaScript
- Homepage: http://plugins.jquery.com/project/jquery-tree
- Size: 265 KB
- Stars: 29
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jQuery-tree
===========
jQuery-tree is a jQuery plugin to make an HTML unorder list (`
- `) in a tree.
The state of the tree expansion will be saved in a cookie. To enable this
feature include the jQuery cookie plugin (http://plugins.jquery.com/project/Cookie).
-------------------------------------------------------------------------------
See the example at http://pioz.github.com/jquery-tree/index.html
-------------------------------------------------------------------------------
USAGE:
You can make an UL in a tree with: `$('ul').tree();`
Avaiable options are:
* open_char: defeault UTF8 character on open node.
* close_char: defeault UTF8 character on close node.
* default_expanded_paths_string: if no cookie found the tree will be expanded with this paths string (default '')
To expand all branches use 'all'.
To collapse all branches use ''.
To expand the first child and the second child of the first child use '0/1'
* only_one: if this option is true only one child will be expanded at time (default false)
* animation: animation used to expand a child (default 'slow')
You can bind a click event to expand/collapse a branch by adding the class
'jtree-button' on a tag inside the branch.
You can call the method 'expand(animation)' or 'collapse(animation)' to expand or collapse the tree.
Animation can be null to use default animation, 'none' to not use animation.
To save the state of the tree expansion when there are many trees in the same
page, you have to specify a cookie key different for every tree. To do this
add the data attribute `data-cookie="unique-key"` to UL tag.
-------------------------------------------------------------------------------
Questions or problems?
If you have any issues please add an issue on GitHub or fork the project and
send a pull request.
-------------------------------------------------------------------------------
Copyright © 2012 [Enrico Pilotto (@pioz)](http://github.com/pioz).
Contributors:
- [Stefano Ceschi Berrini (@stecb)](http://github.com/stecb)