This time I will share jQuery Plugin and tutorial about Automatic Table Of Contents Plugin with jQuery – sdscrollmenu, hope it will help you in programming stack.
sdscrollmenu is a lightweight jQuery table of contents plugin for automatically generating a sticky side navigation from heading tags that features smooth scroll, title / link highlighting, scroll spy and responsive layout.
How to use it:
1. Load jQuery library and the jQuery sdscrollmenu plugin at the end of the document.
1 |
< script src = "//code.jquery.com/jquery-1.11.3.min.js" ></ script > |
2. Call the plugin to generate a sticky table of contents from heading tags within the container ‘target’.
1 |
$( '#target' ).sdScrollMenu({ |
3. Config the table of contents.
01 |
$( '#target' ).sdScrollMenu({ |
10 |
titles: 'h1, h2, h3, h4, h5, h6' , |
13 |
highlightDuration: 1000, |
16 |
highlightColor: '#146' |
This awesome jQuery plugin is developed by stevedavid. For more Advanced Usages, please check the demo page or visit the official website.