1.0.2 • Published 3 years ago

@mkoelewijn/fluidscroll v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

FluidScroll

FluidScroll is a lightweight, modern, customizable and ease to use plugin that will enhance the user experience on your websites by overriding the default scroll.

Based on the following StackOverflow answer by Manuel Otto

npm npm GitHub issues NpmLicense

How to use

Install FluidScroll using a package manager.

yarn add @mkoelewijn/fluidscroll
npm i @mkoelewijn/fluidscroll --save

Import FluidScroll

import FluidScroll from "@mkoelewijn/fluidscroll"

Usage

//Without options - using defaults
let scroll = new FluidScroll();

//With options
let scroll = new FluidScroll({
    speed: 60,
    smoothing: 12
});


//Call to enable smoothness
scroll.init();

Options

KeyValueDefaultDescription
speedint60the amout of pixels to be scrolled per mousewheel step
smoothingint12the smoothness factor, the higher the value, the more smooth.
initfunctionCall to enable smooth scrolling
destroyfunctionCall to destroy smooth scrolling
setPositionfunctionUse to set a position after a scroll position change triggered by something else (anchor link or custom functionality)
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago