dixonandmoe / rellax

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

Centering fails on long pages #214

Closed michael-feh closed 4 years ago

michael-feh commented 4 years ago

Hey there,

i ran into the same issue with rellax as i did with other aparallax libs a while ago: The further down an element is on the page, the more problems occur with the centering.

You can see the issue here: https://www.dropbox.com/s/swuc7w1s0fih2yl/problem.mov?dl=0

The rellax class is applied to the images on the right. I tried both: Element-wise Centering and Global Centering with same results. It seems like rellax has issues with determining where the element should actually be.

Any experience with this kind of behaviour?

Kind regards, Michael

p-realinho commented 4 years ago

Hey Michael,

I'm assuming it might be due to the images not being fully loaded when Rellax kicks in. Could you take a look at #52 / #56 and see if it helps?

Thanks!

michael-feh commented 4 years ago

yup, that fixed it.

i was actually trying this before, just used the wrong window on load function (document ready).

thank you very much. you're a gentleman and a scholar