-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
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
ivarvanwooning, melizzel, mikeingz, Gare22, Jehu and 1 more
Metadata
Metadata
Assignees
Labels
No labels