开发者

jQuery scrollTo/localScroll Speed Control?

开发者 https://www.devze.com 2023-01-06 02:05 出处:网络
I am making a vertically scrolling site, but local开发者_运维知识库Scroll is flying by way too fast. Is there a way to control it\'s speed?When you initialize localScroll, be sure to pass in duration:

I am making a vertically scrolling site, but local开发者_运维知识库Scroll is flying by way too fast. Is there a way to control it's speed?


When you initialize localScroll, be sure to pass in duration:

$.localScroll({ duration: 500 });

On the help page for localScroll it specifies that you can additionally use all the options from scrollTo


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

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号