Example

Click the menu to scroll down and focus on any focusable child nodes. Example code at the bottom of the page.

Section 1

Section 2

Section 3


Installation

$ npm i -S storm-scroll-to

Usage

HTML

JS

Either import and initialise using a named import:

import ScrollTo from 'storm-scroll-to';
            
ScrollTo.init('.js-scroll-to');

Or async using storm-load.js, add the .standalone file to your project, then initialise using the global name:

Load('/content/js/async/storm-scroll-to.standalone.js')
.then(() => {
    StormScrollTo.init('.js-scroll-to');
});