Skip to content

Triggers classes on html elements based on the scroll position. Uses requestAnimationFrame so it doesn't jack the users scroll.

License

Notifications You must be signed in to change notification settings

davidmerrique/ScrollTrigger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScrollTrigger

License Issues GitHub release Bower npm version

Triggers classes on html elements based on the scroll position. It makes use of requestAnimationFrame so it doesn't jack the users scroll, that way the user / browser keeps their original scroll behaviour. Animations run when the browser is ready for it.

How to use?

It's quite simple, just add the ScrollTrigger.min.js file to your HTML page. Then call ScrollTrigger.init() when the page has loaded. Like so:

<script src="ScrollTrigger.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded',