@binaermanufaktur/smoothscroller
v1.0.3
Published
A small plugin to provide smoothscrolling functionality across paths and per parameter in url
Downloads
11
Readme
Install via npm
$ cd my-project
$ npm i @binaermanufaktur/smoothscroller
Edit the JS script you want to include smoothscroller on:
// my-app.js
import {Smoothscroller} from '@binaermanufaktur/smoothscroller';
const smoothscroller = new Smoothscroller();
smoothscroller.init();
In your HTML markup you can now use the class "smoothscroller" with "data-scroll-target" and "data-scroll-path" to enable smooth scrolling links...
<a href="#" class="smoothscroller" data-scroll-target="sampleID" data-scroll-path="/path/to/target/">sampleAnchor</a>