JQuery scrollTo / localScroll Speed ​​Control?

Hey guys, I am making a vertical scroll site, but localScroll flies too fast. Is there a way to control the speed? Thank!

+3
source share
2 answers

When initializing localScroll, be sure to specify the duration:

$.localScroll({ duration: 500 });

The help page localScrollindicates that you can additionally use all the parameters fromscrollTo

+5
source

To use localScroll with speed and easing: Import jQuery, scrollTo , localScroll, and easing . Then put this script under it:

<script type="text/javascript">
    $(function() {
        $('#nav').localScroll({
            duration: 3000,
            easing: 'easeOutQuint'
        });
    });
</script>
+3
source

Source: https://habr.com/ru/post/1752934/


All Articles