• Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!

Question Navigating to Anchor with Offset for Sticky Header not working from Top of Page

P

PCUBED

New Member
I am using anchors to navigate between sections on my one-page website. I have custom CSS to offset the anchor with my sticky header. In my menu/header, I have custom links that use the url of my website with the #"anchor name" at the end.

My problem is that when I first load my page, if I don't scroll and just click a link in the header, the offset doesn't work. Only after I scroll down 1px (or more) and click a link in the header does the offset work. It should also be noted that if I scroll down and then scroll back to the top and click a link in the header, the offset still doesn't work.

I think the problem has something to do with the shrinking sticky header (it shrinks to a smaller size once I start scrolling). Whenever I click a header link below the top of the page, the offset works, whenever I click a link at the very top (with the enlarged header), it doesn't.

I checked to make sure the issue isn't that the header stays large when a link is clicked at the top of the page. It still shrinks during the scrolling animating.

Anyone know how to fix this?
 

Attachments

  • Clicked @ Top of Page.png
    Clicked @ Top of Page.png
    25.8 KB · Views: 593
  • Clicked Below Top of Page.png
    Clicked Below Top of Page.png
    24.8 KB · Views: 529

Latest Resources

Other Elementor Resources

elementor official

Still stuck? Ask the forum

Post your question with a screenshot and a link if you can, and a member will usually reply within a day. Free to join, no sales pitch.

Create a free account
Top