ScrollDir : Leverage Vertical Scroll Direction with CSS

Spread the love

ScrollDir, short for Scroll Direction, is a 0 dependency, ~1kb micro Javascript plugin to easily leverage vertical scroll direction in CSS via a data attribute.


Features:

  • showing or hiding sticky elements based on scroll direction
  • only changing its direction attribute when scrolled a significant amount

  • ignoring small scroll movements

    that cause unwanted jitters

Tags:

Demo: https://dollarshaveclub.github.io/scrolldir/

Download Links

https://github.com/dollarshaveclub/scrolldir

Scroll to Top