autoToc.js
jQuery plug-in to auto generate Table of Contents based on the h2 headings available in the article tag of HTML document.
Features
- Smooth scrolling between sections.
- Fully customizable with CSS.
- Lite weight file size.
- Simple and clean logic.
- User friendly and Easy to implement.
How to Use
Just call the autoToc() in your jQuery code, use the HTML selector, where Table of Contents
to be inserted. For example, if you want to append this TOC in the beginning of your article, the statement will be:
$("article").autoToc();
Similarly, you can insert this autoToc anywhere, i.e in the sidebar , or your desired location.
No need any extra tag, coding or anything more...