Small vanilla javascript library for x,y transforms while scrolling
- RELLAX.js github
<divclass="scroll-motion" data-speed-y="-2">
Vertical scroll slow
</div><divclass="scroll-motion" data-speed-y="7">
Vertical scroll fast
</div><divclass="rellax" data-speed-x="3">
Horizontal scroll
</div><scriptsrc="scroll-motion.js"></script><script>// Accepts any class namevarscrollMotion=newScrollMotion('.scroll-motion');</script><script>// Also can pass in optional settings blockletscrollMotion=newScrollMotion('.scroll-motion',{speedX: -2,speedY: 0,observe: 1,});scrollMotion();</script>- intersection-observer.js | polyfill
To get Scroll Motion running on your local machine do the following steps.
git clone https://github.com/whiteboxpub/scroll-motion.gitcd scroll-motion
or
npm install intersection-observer(polyfill)npm install scroll-motion
- Vanilla JS
- Steven Price - Inital work - stevenjacobprice.com, GitHub
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details