toc.html 684 B

123456789101112131415161718192021
  1. <!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
  2. <script>
  3. $( document ).ready(function() {
  4. // Handler for .ready() called.
  5. $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3,h4' });
  6. /* this offset helps account for the space taken up by the floating toolbar. */
  7. $('#toc').on('click', 'a', function() {
  8. var target = $(this.getAttribute('href'))
  9. , scroll_target = target.offset().top
  10. $(window).scrollTop(scroll_target - 10);
  11. return false
  12. })
  13. });
  14. </script>
  15. <div id="toc"></div>