@pxlrbt/smoothscroll

1.0.0 • Public • Published

Smoothscroll

Smoothly scroll to anchor links.

Installation

npm install @pxlrbt/smoothscroll

Usage

import Smoothscroll from '@pxlrbt/smoothscroll';
new Smoothscroll({
    speed: 400,
    elementSelector: 'a[href*="#"]',
    useHash: true,
    threshold: function () {
        return document.querySelector('header').offsetHeight;
    }
});
<a href="#section">Scroll to section</a>
...
<section id="section">...</section>

/@pxlrbt/smoothscroll/

    Package Sidebar

    Install

    npm i @pxlrbt/smoothscroll

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.72 kB

    Total Files

    4

    Last publish

    Collaborators

    • pixelarbeit