Anchor link scrolls to wrong area on first click but not second

When I click the “Request Demo” button in the main hero area, it scrolls to the middle of the section before it. But if you scroll back to the top of the page after that and try clicking again, then the link works perfectly. Seems to mainly be happening on desktop browsers. Thanks in advance for any insights!

Live site: https://www.aureustechsystems.com/products

Read-Only: https://preview.webflow.com/preview/aureus?utm_medium=preview_link&utm_source=designer&utm_content=aureus&preview=1a647d65eb2fef3ec73603dbcb22369d&pageId=5ee92b43a1e8e55e4459f8c7&mode=preview

Hey Jen,

I think it’s likely to do with the viewport height not been calculated correctly. For example I built a website where I needed to use background Div’s placed within a section, however, they were absolute positioned and I had a similar issue. It’s my understanding that if an element is positioned in this way it’s height isn’t calculated in the viewport.

I tested adding the anchor link to the section above and it worked within the preview, however, Webflow’s preview is different to how the browser works and we can’t publish updates with a share link etc. - I would try testing the link in the section above, if it works just check the section to see if anything is positioned absolutely that might be causing this issue.

Thanks so much for the reply, Dan! Unfortunately, I don’t believe anything is positioned Absolute. The header is Fixed to be sticky, and wondered if that was causing an issue, but its height is not equal to how far off the anchor is landing. Just weird that it works on the second click, which also makes me think the viewport height is not being calculated correctly initially. I also made sure I didn’t have any weird interactions or anything causing an issue. I’m stumped. The even weirder thing is sometimes it randomly works on the first click after reloading. It worked for about an hour yesterday before breaking again (after I had told the client it was working, so not great). I have also reached out to support so will report back if I get an answer. Thanks again!!

Edit: I did have the video play button as Absolute so tried removing it but the issue remained.

Per Webflow Support’s rec, I changed all the images from Lazy Load to Auto and that fixed it :raised_hands:

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.