-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set wrapper to parent element #141
Comments
I second this. |
+1, if you have multiple background images, past the top one it's pretty tricky to use Rellax |
Actually I've managed to get this to work
|
That's gloriously simple and straightforward. I can't believe I've overlooked the relativeToWrapper option all this time! |
Well I only just discovered this library 30 mins ago so benefit of fresh eyes, I was poking around the other issues and someone had done a PR with it, and seems to work! I'm not sure that relativeToWrapper even existed when this issue was created! |
Hm, it seems to have existed up to a few months prior to this issue being created: |
I got lucky then :) Hope it works for you too, I guess with a reference to the element you could always make a |
Been having a similar issue but am worried about the evenr being triggered on scroll. is this how it runs traditionally, firing off a redraw for every pixel of scroll? seems like a lot more work. |
sorry, but this is just bad practice / performance: window.addEventListener("scroll", () => { // fix to init
rellax.refresh();
}); |
Agreed! It's far from ideal. |
If you do this, you should definitely set up a debouncer. |
Would it be possible to add an option to set the
wrapper
to be the immediate parent? I'm working with a lot of generated content, where I don't have the possibility to specify the wrapper based on a class or id selector.The above doesn't break anything, but obviously doesn't have any effect either. Could be a great addition 😃
The text was updated successfully, but these errors were encountered: