How to slow down scrolling speed with Javascript?

2019-06-07 21:26发布

问题:

When I scroll some litlle div with many elements, my mouse scrolling is too fast so I can't see few elements.

回答1:

Scroll speed can't be altered as they are System configurations and Javascript shouldn't be allowed to alter a user's own settings.

But there are a lot of jquery custom scrollbars that you can use, which offer an option to change the scroll speed. Examples: mCustomScrollbar, jquery slimscroll etc



回答2:

You can use NiceScroll plugin with jQuery:

$(document).ready(function() { 

    $("html").niceScroll();

  }

);

Or jQuery.scrollSpeed plugin.