- This topic has 9 replies, 2 voices, and was last updated 4 years ago by Leo.
May 27, 2019 at 8:51 am #912275David Westerlund
I’m trying to link my sub menu items to sections further down on the page. But the behavior is not fully as I want it to be. There is basically two problems:
1. I want the first menu item to be highlighted when I enter the page, since that’s the top section, “Vi som jobbar här”. But I can’t get it to be highlighted. It works if I choose just “/kontakt/” as path for the menu item. But then the highlight won’t go away when I scroll down the page to other sections. Maybe the highlight would work if I set an ID to the body-element of the page. Or how is this supposed to work? I wanna know if there is an idea behind this? How it supposed to work.
2. When clicking a sub menu item, the page scrolls down very nice and smoothly. But it stops at a point where the title for that specific section gets hidden behind the sticky navigation. What is the idea here? Is there any setting I missed to tell the scrolling that I’m using a sticky navigation?May 27, 2019 at 9:56 am #912369LeoStaffCustomer Support
1. Hmm I don’t think it’s possible to highlight the menu item “Vi som jobbar här” when you enter that page as there is no relationship between that menu item and the page.
The item “Kontakt” is highlighted because it’s on that page.
As you already discovered, the only way to highlight that menu item is to use the same link as Kontakt.
2. Are you using GP’s smooth scroll? It should take the sticky navigation height into consideration:
Let me know 🙂May 27, 2019 at 10:29 am #912404David Westerlund
About problem 1, no, but if I set #vi-som-jobbar-har to the menu item and if the body tag would have that ID. Wouldn’t that work?
About problem nr 2. Okay, I have enabled the smooth scroll now from general settings. I have also added the smooth-scroll class to the “Skriv till oss” menu item for testing. And it seems to first scroll to the right position, just to change the position right after. What’s wrong?May 27, 2019 at 10:31 am #912408LeoStaffCustomer Support
1. Hmm I’m not sure but you can definitely give it a shot. GP just uses the default WordPress menu system and doesn’t interfere with how it works.
2. Looks like some sort of conflict. Did you disable the previous smooth scroll script?May 27, 2019 at 10:47 am #912425David Westerlund
I haven’t enabled any other smooth scroll, at least not on purpose. We don’t even have that many plugins installed. Elementor doesn’t have any smooth scroll right?May 27, 2019 at 10:48 am #912428LeoStaffCustomer Support
Hmm there was smooth scroll originally before I asked you to use GP’s smooth scroll so it must be coming from somewhere.
I don’t know if Elementor has smooth scroll or not.May 27, 2019 at 11:57 am #912487David Westerlund
Okay so apparently Elementor has a built in smooth scrolling that is not possible to just disable. But there is a walkaround where I could just add a HTML-widget with a anchorlink as target. So it works now. It’s GeneratePress’s smoothscroll. But now the highlighting isn’t working. So that’s not a feature that GeneratePress has? That the menu items are highlighted for when the menu item’s anchor matches the #id in the web address?May 27, 2019 at 12:07 pm #912495LeoStaffCustomer Support
You will need a plugin like this I believe:
https://generatepress.com/forums/topic/custom-link-anchors-and-nav-dropdown-colors/#post-666094May 27, 2019 at 12:12 pm #912498David Westerlund
Aha, a totally other scroll plugin. But then I will lose the GenerarePress smooth-scroll feature that is aware of the sticky header…?May 27, 2019 at 12:59 pm #912526LeoStaffCustomer Support
Should still work.
Give it a shot and let us know if you encounter issues again 🙂
- You must be logged in to reply to this topic.