1.0.1 • Published 5 years ago

smoothscrolljs v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Smooth Scroll

A lightweight JavaScript package form smooth scroll animation

Installation

Install with npm:

npm install smoothscrolljs

Install with yarn:

yarn add smoothscrolljs

Usage

import smoothScroll from 'smoothscrolljs'

const destinationEl = document.querySelector('.scroll-to')
smoothScroll(destinationEl)

Parameters

NameDescriptionTypeDefault
destinationDOM element to scroll to or a positionHTMLElement, Number-
opts-Object-
opts.duration-Number600
opts.easingfunction or name of one of predefined easing functions ('linear', 'easeIn', 'easeOut', 'easeInOut')Function, String'easeInOut'
opts.contextan element to apply scroll toHTMLElementwindow
opts.orientationscroll orientation ('horizontal', 'vertical')String'vertical'
opts.offsetscroll offset in pxNumber0
opts.onUpdatea function that is called on every changeFunction-
opts.onCompletea function that is called on animation endFunction-

License

smoothscrolljs is licensed under MIT license.

1.0.1

5 years ago

1.0.0

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

7 years ago