scrolled-header

1.0.11 • Public • Published

Scrolled Header

Add active class to fixed header while scrolling down and remove when scrolling up.

Installation

npm install scrolled-header

Usage

import Header from "scrolled-header";

new Header({
  target: document.getElementById("js-header"), // required
  className: "scrolled",                        // active class
  offset: 50
});
<header id="js-header">
  ...
</header>

/scrolled-header/

    Package Sidebar

    Install

    npm i scrolled-header

    Weekly Downloads

    2

    Version

    1.0.11

    License

    MIT

    Unpacked Size

    4.64 kB

    Total Files

    4

    Last publish

    Collaborators

    • silverhow