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

Links to anchors within a page #62

Closed
classikd opened this issue Nov 17, 2019 · 2 comments
Closed

Links to anchors within a page #62

classikd opened this issue Nov 17, 2019 · 2 comments

Comments

@classikd
Copy link

Hello,

I would like to use links to go on specific locations on my page, for example a "back to the top" button. But it is always redirecting me to the homepage.
How could i use such links without the router does anything ?

Thank you

@ItalyPaleAle
Copy link
Owner

window.scrollTo(0,0)

See MDN: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo

You can add this to the routeLoaded callback

@classikd
Copy link
Author

I was asking in case a workaround to keep the native behavior without javascript exists.
But from your answer I imagine this is not doable.

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

No branches or pull requests

2 participants