angular-scroll-collapse

A simple lightweight library for Angular 2/4+ with no other dependencies that detects scroll direction and adds a `sn-scrolling-up` or `sn-scrolling-down` class to the element.
Homepage:
0 people use it
Author: 6976199?v=3 thisissoon
Submitted by: 7836746?v=4 edoparearyee

Angular Scroll Collapse

Build Status Coverage Status

A simple lightweight library for Angular (2/4+) with no other dependencies that detects scroll direction and adds a sn-scrolling-up or sn-scrolling-down class to the element. The library can also detect when the user has scrolled passed the element and apply a sn-affix class. Useful for make a element sticky when the user has scrolled beyond it. This library can will also apply sn-minimise class after the user has scrolled beyond the height of the element.

This is a simple library for Angular, implemented in the Angular Package Format v4.0.

Install

npm i @thisissoon/angular-scroll-collapse --save

app.module.ts

Examples

Scroll direction

Affix mode

In this scenario the nav element will have the class sn-affix added when the user scrolls past the header element and the nav is at the top of the viewport.

Minimise mode

In this scenario the nav element will have the class sn-minimise added when the user scrolls 100px (the original height of the element) down the page.

Specify debounce time (default: 100ms)

comments powered by Disqus
This page was last updated 3 months ago.