JQuery Plugin Repository

Close Complete List of Plugins

buildTreeNav  |  Category: Navigation  |  Modified: 19 Oct 2009  |  Dynamically construct a tree view navigation system.

This plugin transforms a set of nested, unordered lists into an tree view navigation system, with expandable and collapsable nodes.

Summary

Script File

jq.buildTreeNav.js ( view )

Available Options

overallWidth

A string specifying the overall width of the navigation module. Default value is "auto", which will fill the containing element.

controlAll

Boolean value specifying whether to include global control links to expand and collapse all nodes. Default value is true.

controlAlign

A string specifying the horizontal alignment of the control elements. Default value is "left".

initialState

A string specifying whether the tree nodes should be "collapsed" (the default) or "expanded" when the page initially loads.

Basic Usage

$("ELEMENT").buildTreeNav();

$("ELEMENT").buildTreeNav({ options });

where ELEMENT is an unordered list.

Minimum Browser Support

  • Apple Safari 3
  • Google Chrome 1
  • Microsoft Internet Explorer 6
  • Mozilla Firefox 3
  • Opera 9

Note: There is a slight display anomaly in IE6, due to a bug in that browser's CSS implementation, that can be seen if folder nodes are opened and closed in a particular order. Functionality is not, however, impaired in any way.

Example 1

Example 2

This example specifies a fixed width, and displays the global control links aligned to the right.

Associated Code

<script type="text/javascript">
$(document).ready(function() {
  $("#navLists2").buildTreeNav({
    overallWidth : "200px",
    controlAlign : "right"
    });
  });
</script>

Example 3

This example specifies a fixed width, but suppresses display of the global control links and expands the tree nodes on the initial page load.

Associated Code

<script type="text/javascript">
$(document).ready(function() {
  $("#navLists3").buildTreeNav({
    overallWidth : "300px",
    controlAll   :  false,
    initialState : "expanded"
    });
  });
</script>

JQuery Plugin Repository | Home | Print

back to ksscholl.com