Create Smooth Momentum Scrolling Effects – Butter.js

Category: Animation , Javascript | September 5, 2020
Author: BCJdevelopment
Views Total: 878 views
Official Page: Go to website
Last Update: September 5, 2020
License: MIT


Create Smooth Momentum Scrolling Effects – Butter.js


Butter.js is a plain JavaScript library that applies a smooth momentum scrolling (also called inertial rolling) to any scrollable elements on the web.

Inspired by luxy.js library. Use this library to bring an iOS scroll experience to your web app.

How to use it:

1. Download and import the butter.js library into the document.

<script src="./butter.js"></script>

2. Add your scrollable element into a container with the ID of ‘butter’. That’s it.

<div id="butter">
  List Or Grid Item 1
  List Or Grid Item 2
  List Or Grid Item 3

3. Override the default wrapper ID.

  wrapperId: 'butter'

4. Disable the Momentum Scrolling Effects on mobile devices. Default: false.

  cancelOnTouch: true

5. Set the damping factor. Default: 0.08

  wrapperDamper: 0.06



  • added resize on window load


  • resize fix

You Might Be Interested In:

Leave a Reply