anchorscroll
v0.0.2
Published
Dependency-free smooth-scrolling to hashed anchors
Downloads
13
Maintainers
Readme
anchorscroll
Dependency-free smooth-scrolling to hashed anchors
Install
With yarn:
$ yarn add anchorscroll
With npm:
$ npm install --save anchorscroll
Usage
const anchorscroll = require('anchorscroll');
// anchorscroll(speed, selector, offset)
// Speed: the default is 0.5
// This defines how quickly you scroll from current position to anchor
// Selector: the default is '.achorscroll'
// This determines the classname for anchorscroll to watch
// Offset: the default is 30
// You can use this to offset the scroll by the height of a top bar for example