dixonandmoe / rellax

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

FIX/rellax.js: introduce document.onreadystatechange to call init() #180

Closed guidoschmidt closed 4 years ago

guidoschmidt commented 4 years ago

Trying to solve Issue #40. I'm absolutely not sure if that really solves the bug, as I have used rellax.js only for some hours yet and lacking of experience using it as a library. But it seemed to me, that the init() function needs to be called after the document has loaded in order to get more correctish values for the y position 🤔

See https://streamable.com/2fwnq for demo

moeamaya commented 4 years ago

@guidoschmidt Can this be solved by calling the rellax.js when the document is ready? If so I will just update the README instead of requiring it in the code.

guidoschmidt commented 4 years ago

True, might actually be the better option to put it into the README and ensure a finished document load on the user side of rellax.js 🤔 👍