Inject Custom CSS and JavaScript

Comments

1 comment

  • Avatar
    Volker Weinreich

    Working solution from Google Group from David Majninger (k15t):

    Hi Volker,

    I have done a little bit of testing and found that it's enough to just remove the generic TOC and invoke it again, but you need to wait a little first to let the theme finish its code first. 
    Here's the code that worked for me, depending on your system, you might need to adjust the timeout milliseconds:
     
    $( document ).ready(function(){
      setTimeout(function(){
          $("ol.toc-list").remove();
                tocbot.init({
                tocSelector: '.js-tocBot',
                contentSelector: '.js-tocBot-content',

                headingSelector: 'h1, h2, h3, h4, h5',
                linkClass: 'article__content__toc__link',
                activeLinkClass: 'article__content__toc__link--active',
    scrollSmooth: true,
                scrollSmoothDuration: 500,
    headingsOffset: 1,
                collapseDepth: 2,
                });
      }, 500);
    });
     
    Cheers,
    David
    1
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk