Skip to content
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

Anchor tag forces incorrect positioning #66

Open
macphersonj opened this issue Jul 18, 2017 · 4 comments
Open

Anchor tag forces incorrect positioning #66

macphersonj opened this issue Jul 18, 2017 · 4 comments
Labels

Comments

@macphersonj
Copy link

Rellax is great, though I'm wondering if you have a solution for my issue:

I have anchor links on my site. Clicking an anchor jumps to the relevant section (obviously, expected behaviour). The issue is that the positioning of all the rellax elements stays where they are pre-scroll. Is there a way to update the position when an anchor tag is clicked?

@macphersonj
Copy link
Author

I've managed to fix this via:

  1. Adding smooth scrolling for anchor links (obviously 'jumping' instead of scrolling doesn't adjust the position). I'd still like to find a way to update the rellax items' positions without smooth scrolling.

  2. When accessing an anchor link from a different page, the same thing happened. The workaround for this is:

window.onload = function(){ var rellax = new Rellax('.rellax', {center: true}); }

I'll leave this open as the original issue still exists, but hopefully the workaround is useful

@moeamaya
Copy link
Member

@macphersonj James thanks for the issue. I haven't had this use case yet, so appreciate you bringing it up. I like your hacked solution a lot but we'll work on something that is built-in.

@moeamaya moeamaya added the bug label Nov 2, 2017
@aerni
Copy link

aerni commented Apr 3, 2018

Is this something that is going to be fixed soon? I'm using this library for a vertical anchor navigation. The problem is, that tons of white space gets added at the bottom of the page when clicking one of the buttons and jumping to a section. When clicking the first anchor, the white space disappears again.

Here's a video showing the issue

@shrpne
Copy link
Contributor

shrpne commented Apr 3, 2019

I guess whitespace is added because of rellaxed elements translates under the bottom of the body. You can try to control them with data-rellax-max option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants