- This topic has 13 replies, 3 voices, and was last updated 5 years, 11 months ago by Tom.
-
AuthorPosts
-
May 29, 2018 at 11:30 am #587280Wolf
If you visit the homepage you see that I have a onepage design for my homepage. When I click services it jumps to the anchor I placed with elementor but the home nav stays green. Additionally, I want the navigation to be colored in it’s respective color when scrolling to it’s anchor. And sometimes every single navigation tab stays green like this. Even if I haven’t clicked any
May 29, 2018 at 2:10 pm #587382LeoStaffCustomer SupportHi there,
Can you take a look at this thread and see if the solution works for you as well?
https://generatepress.com/forums/topic/menu-coloursMay 29, 2018 at 2:34 pm #587399WolfI installed https://wordpress.org/plugins/page-scroll-to-id/ and added the following code
.main-navigation .main-nav ul li.sfHover > a { background-color: #878787; }
This didn’t fix the automatic highlighting when scrolling to an anchor neither did it fix the colors.
The problem might be that I have a mix of both on my website ( one page with navigation and one static blog page )May 29, 2018 at 8:50 pm #587547TomLead DeveloperLead DeveloperIn that plugins settings, try setting replacing the
mPS2id-highlight
class withcurrent-menu-item
.That way you shouldn’t need any custom CSS.
May 30, 2018 at 7:41 am #587837WolfUnfortunately that didn’t change anything. Colors are still bugged
May 30, 2018 at 10:34 am #588057TomLead DeveloperLead DeveloperHmm, ok – switch the class back to what they had before.
To remove the constant green on the home page, we can use this CSS:
.home .main-navigation .main-nav ul li[class*="current-menu-"] > a { color: #fff; }
Then we should just need to add some CSS to highlight them green as we scroll down.
.home .main-navigation .main-nav ul li.mPS2id-highlight > a { color: #6cb670; }
May 30, 2018 at 12:31 pm #588172WolfHi thanks for the quick response Tom, I added `.home .main-navigation .main-nav ul li[class*=”current-menu-“] > a {
color: #fff;
}`
This which removed the colorthe second code you provided didn’t highlight the current anchor though.
Is it possible to achieve this without the plugin ?May 30, 2018 at 8:48 pm #588403TomLead DeveloperLead DeveloperWithout the plugin you would need some custom javascript.
Did you change the highlight class back to default inside the plugin?
May 31, 2018 at 5:37 am #588664WolfYes I changed it back, then tested it. No change.
Uninstalled it to test it; nothing.
What javascript would I need ?May 31, 2018 at 11:03 am #588995TomLead DeveloperLead DeveloperIt’s pretty complicated, you’re way better off using the plugin. Is it still deactivated?
It’s not adding any classes to the menu items right now as it should be.
May 31, 2018 at 11:04 am #588999WolfI reactivated it, the problem is that it scrolls to far, so that a part of the heading is cut off
May 31, 2018 at 8:41 pm #589249TomLead DeveloperLead DeveloperThat’s because your sticky navigation is sitting on top of it.
Does the plugin have an offset value? If so, you can set it to the height of your sticky navigation.
June 1, 2018 at 2:26 am #589373Wolffound the offset, but how do I fix the colors now ?
June 1, 2018 at 9:46 am #589660TomLead DeveloperLead DeveloperThat must be one of their settings. Right now no classes are being added to the menu items as you scroll down, so something is turned off or misconfigured.
I’m not super familiar with their plugin, so it might be worth contacting them to see if it’s a simple setting somewhere.
-
AuthorPosts
- You must be logged in to reply to this topic.