javascript – How to make the scroll of a page smooth?

Question:

How to make the Scroll (scrollbar) of a page look smooth? And if they can, how to customize it.

Example: http://themenectar.com/demo/salient/blog/

Answer:

That page you referred to uses a jQuery plugin called NiceScroll .

It's pretty easy to implement, you just need to put this code inside your <head> tag.

#1 – load the jQuery library

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

#2 – load the NiceScroll library

<script src="http://areaaperta.com/nicescroll/js/jquery.nicescroll.min.js"></script>

#3 – activate the plugin on the page

$(document).ready(function () {
    $("html").niceScroll();
});

Example

Other plugins:

Scroll to Top