Need help with scrollin?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

samccone
124 Stars 11 Forks MIT License 59 Commits 3 Opened issues

Description

:scroll: A leak free performance focused scroll util

Services available

!
?

Need anything else?

Contributors list

# 2,374
JavaScr...
codeign...
backbon...
marione...
45 commits
# 638,026
JavaScr...
Shell
CSS
3 commits
# 335,858
Sublime...
Babel
php7
es2016
2 commits
# 171,735
Ruby
Zsh
schema-...
MySQL
1 commit
# 90,885
learnin...
jQuery
HTML
startup
1 commit
# 125,709
Objecti...
Xcode
Markdow...
markdow...
1 commit
# 101,152
buckles...
reasonm...
Node.js
Sass
1 commit

Scrollin

Do something great when an element enters the viewport. Build Status
scrollin

Install

npm i scrollin
bower i scrollin

Use

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

Options

You can specify optional offset params to control when an elements is considered in the "viewport".

Scrollin.track(document.querySelector('#hi'), () => alert('hi!'), {
  top: 10,
  right: -10,
  bottom: 10,
  left: 10
})

API

  • Scrollin.track(document.querySelector('#hi'), () => alert('hi!'))
  • Scrollin.track(document.querySelectorAll('.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

📜

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.