Archived topic
Tab layout: Disable scroll to anchor
8 replies · Started by Juste on November 27, 2021
Hello.
I'm putting up a tab display using anchor links.
When I click on the link, the screen jumps to the anchor, putting the link out of view. Is it possible to avoid this jumping?
When I test the tabs outside of GP context, like a basic codepen, there are no jumps.
Hi there,
Can you take a look at this video first and see if it helps?
https://docs.generatepress.com/article/smooth-scroll/
Let me know :)
Hi. Thank you for the quick reply.
I rated all the video. It is about smoothing the scroll.
What I need in my tab section is actually no scroll at all. Is that possible?
Hi there,
the jumplink is a browser default behaviour, and its unavoidable with the method you're using for your tabs.
You would need to use a javascript based method that doesn't rely on Target IDs or has preventDefault() on the links.
oh thanks. I switched tabs method to checkboxes.
I still need help with the page though. In the inspector, the back-to-top button is visible normally. But on my actual mobile (Huawei Mi9 with Chrome), the back-to-top button appears only at the bottom of the page and is overflown way to the right. Do you have any idea?
Thanks.
Hi Juste,
Can you disable all plugins except GP premium to test?
Got it. A bug with an image tranferred from google docs. All sorted now. Thanks.
No problem :) Glad you sorted it out!