
scrooth is a small JavaScript library that adds a configurable, momentum style smooth scroll effect to the native page scroll.
How to use it:
Import the scrooth library into your document and done.
<script src="scrooth.js"></script>
By default, scrooth will automatically enable the smooth scroll effect on the whole body:
const body = new Scrooth();
You can also initialize the scrooth on any scrollable element you prefer.
const scroll = new Scrooth({
element: window // target element
});Config the smooth scroll with the following parameters.
const scroll = new Scrooth({
strength: 10,
acceleration: 1.2,
deceleration: 0.975
});Changelog:
01/26/2021
- Prevent flickering
11/06/2018
- JS refactor







