Home

Awesome

Scroll Behaviour

This is a paper thin wrapper around the existing https://github.com/iamdustan/smoothscroll polyfill.

It allows for importing in nodejs (which does nothing), and automatically calls smoothscroll.polyfill() in the browser to make things simpler.

Installation

Npm

npm install scroll-behaviour

Example Manual

// commonjs
require('scroll-behaviour').polyfill()

// es6
import { polyfill } 'scroll-behaviour'
polyfill()

Example Automatic

Automatically call .polyfill()

// commonjs
require('scroll-behaviour/polyfill')

// es6
import 'scroll-behaviour/polyfill'

Browser Support

Successfully tested in:

If you have tested this and worked as expected in a different browser let us know so we can add it to the list, if not open an issue providing browser, browser version and a good description about it.

Standards Documentation