Hierarchical Table Of Contents – A Vanilla JavaScript plugin used to create a hierarchical, list-based table of contents for long web content. A lightweight and simple table of contents plugin to generate hierarchical in-page navigation for an extended webpage sectioned by heading components.
create table of contents, comprehensive table of contents headings and hierarchy, what is a table of contents
Hierarchical jQuery Folder Tree Structure Plugin In HTML CSS | zTree
How to make use of it:
1. Add the data-no-toc
attribute to heading components that must be ignored.
<h4 data-no-toc="">This Heading will be excluded</h4>
2. Create a container to put the table of contents.
<div class="toc-wrapper"> <div class="toc-header">Table of Contents</div> </div>
3. Initialize the easy-toc plugin and also you’re completed.
let mytoc = new easy_toc( document.querySelector('.toc-wrapper'), { // options here }); mytoc.init();
4. Determine an array of heading components to be included. Default: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
.
let mytoc = new easy_toc( document.querySelector('.toc-wrapper'), { include: ['h1', 'h2', 'h3'] });
5. Enable or disable the hierarchical construction.
let mytoc = new easy_toc( document.querySelector('.toc-wrapper'), { hierarchical: false });
6. Customize the anchor connected to the heading components.
let mytoc = new easy_toc( document.querySelector('.toc-wrapper'), { prefix: 'easy_toc_', anchor_nodename: 'div', anchor_class: 'anchor' });
7. API strategies.
// update the TOC mytoc.update(); // destroy the TOC mytoc.destroy();
Javascript Table of Contents, jQuery Table of Contents Plugin, Hierarchical Table Of Contents Plugin, Create Table of Contents Javascript
See Demo And Download
Official Website(bfiessinger): Click Here
This superior jQuery/javascript plugin is developed by bfiessinger. For extra Advanced Usages, please go to the official website.