dixonandmoe / rellax

Lightweight, vanilla javascript parallax library
https://dixonandmoe.com/rellax/
MIT License
7.07k stars 877 forks source link

Missing Ability to Delay Effect #213

Closed Chaoste closed 3 years ago

Chaoste commented 4 years ago

Hi,

I'm using this plugin to move a banner image on pages slower than the following content which works nicely. But when I apply this effect on a banner at the bottom of the page, it won't work properly since it's just directly linked to the scrollTop variable but doesn't care whether my target node isn't yet in the viewport. It would be nice to give a starting position or use a scroll observer. Sot one can start the animation as soon as the element becomes visible and is independent of it's position on the page.

Greetings, Thomas

p-realinho commented 4 years ago

Hey, Thomas. Thanks for using Rellax.

Have you tried using the center option, or the percentage attribute? Take a look at this section of the readme and let me know if it solves your issue.

Thanks.

Chaoste commented 3 years ago

Hi,

thanks for pointing me to this feature. That's exactly what I was looking for!

Have a nice day, Thomas