dixonandmoe / rellax

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

Start the animation before Rellax Item enters Viewport #235

Open floatwork711 opened 3 years ago

floatwork711 commented 3 years ago

Hi

Is there any chance to start the Rellax Animation just before the animated item enters the viewport. In my case there are some items on the very bottom of a long page and they start moving when i start scrolling from the very top.

Any ideas to solve this problem?

markatli commented 3 years ago

You probably need to use something like waypoint.js which allows for some function to fire when an element enters the viewport.

R3dRidl3 commented 2 years ago

This is a must have option. It should only start when element is (partially) in view and stop when out of view. Also then the calculation should not be on the total page scroll, but how many was scrolled when the item was in view. Or else you get jumpy stuff.

cvillalobos commented 2 years ago

Does it mean it always starts moving from the top of the page when scrolling? what about the 'wrapper' property on the initialization? I've been trying to accomplish the effect with this, maybe that is why it doesn't work.

MarkoMlinarevicDept commented 2 years ago

@cvillalobos did you succeed? I'm having the same issue, I just want paralax effect to trigger when it's in viewport

p-realinho commented 2 years ago

Hi everyone, please have a look at the centering options. https://github.com/dixonandmoe/rellax#element-wise-centering