tomca32 / scrollin

:scroll: A leak free performance focused scroll util

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scrollin

scrollin

**Do something great when an element enters the viewport.**










Install

npm i scrollin
bower i scrollin

Use

Scrollin.track(document.querySelector('#hi'), () => alert('hi!'))

API

  • Scrollin.track(document.querySelector('#hi'), () => alert('hi!'))
  • Scrollin.untrackAll()
  • Scrollin.untrack(document.querySelector('#hi'))
  • Scrollin.checkForVisibleElements()
  • Scrollin.getTracking()

Dev

  • npm i
  • npm run dev

Building

  • npm run compile

Polyfill Caveats

  • You may need to polyfill window.requestAnimationFrame
  • You may need to polyfill Array.prototype.splice
  • You may need to polyfill Array.prototype.some

📜

Build Status

About

:scroll: A leak free performance focused scroll util

License:MIT License


Languages

Language:JavaScript 96.5%Language:HTML 3.5%