Tree Plugin

The tree plugin converts a nested list into a tree view where sub menus can be expanded.

Usage

This plugin can be activated using the data-api or jQuery.

Data Api

Add data-widget="tree" to any ul or ol element to activate the plugin. All options can be passed using the data api. Example: data-animation-speed="1000".

jQuery

Options

Name Type Default Description
animationSpeed Number 500 Speed of slide down/up animation in milliseconds.
accordion Boolean TRUE Whether to collapse the open menu when expanding another.
followLink Boolean FALSE Whether to follow the link in the a element instead of expanding the sub menu.
trigger String .treeview a Selector of the element that should respond to the click and result in expanding or collapsing it sibling sub menu.

Events

Name Description
expanded.tree Triggered after a sub menu expands.
collapsed.tree Triggered after a sub menu collapses.

Example: $('ul').on('expanded.tree', handleExpandedEvent)

PREMIUM TEMPLATE
MaterialPro

MaterialPro ─ $35

Material Bootstrap 4 Admin Template

Preview Buy Now

12+ purchases