A plugin that generates table of contents(TOC) dynamically for both jQuery or non-jQuery.

Install

  1. bower install jquery-toc

Compatibility

  1. non-jQuery version works on IE9+
  2. jQuery version works on anywhere with jQuery

Usage

non-jQuery

  1. // returns an ordered-list of headers in page content
  2. varlist =initTOC(options);
  3. // then you can append it to anywhere you like
  4. container.appendChild(list);

jQuery

  1. // will append TOC list to target element
  2. $(elem).initTOC(options);

Options

License

MIT.