Learn2 left sidebar

My goal is a Sidebar non-bounce up in Learn2 theme (by code change).
The example I refer to is (where it works perfectly):
W3 Schools

Then scroll down the left sidebar and click on Mobile (something that is lower than your screen).
Notice the left sidebar stayed in place when you landed on the new page.
The left sidebar did not bounce back to the page top.

Learn2 left sidebar always bounces back to the top when a long list of links exist lower than your screen.

We would like to code into Learn2 theme so that the left sidebar does NOT bounce up.

Does anyone know how it can be coded (or already have coded it).
Thanks.

In /themes/THEMENAME/templates/partials/base.html.twig add this code right before the closing body tag:

<script>
// MOD.hs Scroll to active menu
//
$(document).ready(function() {
    $('nav').animate({
        scrollTop: $(".active").offset().top
    }, 1000);
});</script>

I tested it with Quark. Should work with Learn2, too.

– Harald

Thanks, we’ll try it. Otherwise I may switch to another Grav Theme that already flows better in the Navigation.