awesome-scroll
A simple and fast container to monitor elements as you scroll https://stephenkingsley.github.io/stress.html
BASIC USAGE
first
npm install awesome-scroll --save
and in your code
; const scrollElement = document;const watcherElement = awesomeScroll; const addClass = { if !thisisInViewport return; else if thisisFullyInViewport thiswatchItemstylebackgroundColor = '#fcc'; else if thisisAboveViewport thiswatchItemstylebackgroundColor = '#ccf'; else if thisisBelowViewport thiswatchItemstylebackgroundColor = '#ffc'; } watcherElement;
DEMO
👇 localhost demo
git clone https://github.com/stephenkingsley/awesome-scroll.git cd awesome-scroll npm i npm run dev