GithubHelp home page GithubHelp logo

stecb / jquery-tree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pioz/jquery-tree

1.0 1.0 0.0 216 KB

jQuery-tree is a jQuery plugin to make an HTML unorder list (<ul>) in a tree.

Home Page: http://plugins.jquery.com/project/jquery-tree

JavaScript 100.00%

jquery-tree's Introduction

jQuery-tree

jQuery-tree is a jQuery plugin to make an HTML unorder list (<ul>) 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).

Contributors:

jquery-tree's People

Contributors

stecb avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.