• Hello Michael,

    Thank you for great plugin !

    I had a problem, because I use a sticky header on my theme, and as I click an item in the TOC, it scrolls but slightly too much because of it, and eventually is hidden below the sticky header.
    No I tried to tackle the problem, and found a solution that I’d like to share with you and your commmunity.

    At line 1388-1389 of toc.php :

    $matches[$i][1] . '<span class="anchor" id="' . $anchor . '">',
    '</span></h' . $matches[$i][2] . '>'

    should be replaced by :

    $matches[$i][1] . '<span class="anchor" id="' . $anchor . '"></span>',
    '</h' . $matches[$i][2] . '>'

    in the screen.css (or rather eventually screen.min.css), add the following code :

    h2, h3{ position:relative; }
    h2 span, h3 span{ position:absolute; top:-60px;}

    Of course, you should had h4,h5 accordingly, for the sake of completeness.
    -60px matches the height of my sticky header.

    You can see it in action in the link provided.

    I thought that could be a nice features for the next version.

    Cheers,

    The page I need help with: [log in to see the link]

  • The topic ‘Tweak suggested when used with a sticky header’ is closed to new replies.