You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there.
I noticed that you are calculating element height based on offsetTop value which is relative to closes parent. That means when i put your parallax image into some content wrapper in the middle of page height, then this calculations are based on that wrapper and not on window, so it ends up with half of image because of wrong calculations.
Hi,
I had an issue with sticky headers: the parallax backgrounds were shifted according to its parent element (the image wasn't covering the entire element). With this update, the issue is solved, thanks you!
Hi there.
I noticed that you are calculating element height based on
offsetTop
value which is relative to closes parent. That means when i put your parallax image into some content wrapper in the middle of page height, then this calculations are based on that wrapper and not on window, so it ends up with half of image because of wrong calculations.PS. As a reference i fixed it by myself for own purposes, but you can review and use it as well. It was about to change the line : https://github.com/marrio-h/universal-parallax/blob/master/dist/universal-parallax.js#L48
into
var containerTop = document.documentElement.scrollTop + container.top
The text was updated successfully, but these errors were encountered: