[Resolved] Menu anchor offset for page built with Sections

Home Forums Support [Resolved] Menu anchor offset for page built with Sections

Home Forums Support Menu anchor offset for page built with Sections

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #807249
    Maren

    Hi, I’m trying to link each of the four sections on a page (built using Sections) to their own dropdown menu link. The parent menu item I’m linking with the page URL, the sections with the Custom ID. Everything works in tablet and mobile but in the desktop version, while clicking on the dropdown link does scroll to the indicated section, the section heading is mostly covered by the sticky menu. (Smooth scrolling is on)

    Two questions:

    1) Is there any way I can offset the scroll so the whole section heading is visible?

    2) Should I include the page URL before the Custom ID in the menu link? I haven’t gone live yet with the page but in testing, the dropdown links only seem to work when I am on the actual page the section is on, but the client would obviously want visitors to be able to click on one of links in the dropdown menu and have it work from anywhere on the site.

    Thank you.

    #807670
    Leo
    Staff
    Customer Support

    Hi there,

    I visited your page but don’t see any anchors.

    Have you checked out this article?
    https://docs.generatepress.com/article/smooth-scroll/

    The smooth scroll option integrated with the sticky navigation, so the top of your anchor point isn’t hidden.

    Let me know 🙂

    #808765
    Maren

    Thank you, that worked beautifully (and so easy once you know it).

    The page I am attempting this on is not yet published as the site is live and I’m only publishing the page if it works, that’s why you couldn’t find it.

    Only problem now is that if I add the page URL before the #section-ID, it takes me to the top of the page, not the section (although once on the page, the anchor works as intended).

    And if I only put in the #section-ID without the page URL, nothing happens when I click on the dropdown menu item on my test page unless I am already on that page.

    Does this menu anchor to sections on a page only work properly on a one page website or am I missing something?

    #808791
    Leo
    Staff
    Customer Support

    Yeah it only works when the anchor is on the same page currently.

    #808825
    Maren

    Aah, ok. Thank you for your help all the same. I’ll just have to rethink that whole part then.

    #809589
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.