Skip to content

Execute a function when an entire element scrolls into view.

Notifications You must be signed in to change notification settings

gborbonus/onViewOnOff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

onViewOnOff

A simple library that allows you to add the tags "sah" and "saho" to your elements.

Anytime an element that has these tags is within view(scrolled to, or in view already when page loads), the sah function will run, and when removed from view(scrolled out of view), the saho function will run.

saho is not required.

Options:

By default sah will not run it's function until the bottom left of the element is within view, you can set this to "anything" to make it so any part of the element within view will execute the function.

About

Execute a function when an entire element scrolls into view.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published