Active links in navigation
This support request was posted in Smart by mertxe
- mertxe March 27, 2018 at 2:33 am
Hi! Me again 🙂
Don’t know what i’m doing wrong but i’ve set up 3 anchor links in my home page, but they are always “active”, i just want them to turn blue only when the scroll is at that section. Is this possible? I can’t find what i’m doing wrong in this menu.Thanks!
Juanfra Aldasoro March 27, 2018 at 1:12 pmHi Mertxe,
I hope you are doing well.
Those three links are custom links you’ve added to the menu with the anchor link as the ID of the row you’re trying to link to?
Best,
Juan.mertxe March 27, 2018 at 2:35 pmYes, i’ve used anchor links.
I’ve changed the way “campaña” is linked to have a better example: campaña is linked with only “#campana” and then i can have smooth scrolling and correct active coloring, but if i’m navigating a inner page like shop, it doesn’t work.
Then in “locales” the link is “https://mertxe.com.ar/mirandoalmar/#locales”, it’s always colored when at the home page, but it works from inner pages.i need the best of both options: smooth scrolling, right coloring, and that it works when i’m at inner pages.
is this possible?
Juanfra Aldasoro March 27, 2018 at 3:54 pmHi Mertxe,
Thanks for the prompt response.
Yes, you are right. They are being colored because you’re using the full URL instead of just linking to the anchor you need. This functionality was meant to work for one-page sites.
Would you please try to replace the file smart/includes/nav-menus/class-nice-custom-navigation-menu.php with this new file and see if this patched version works for you? https://cloudup.com/cTgoieHQixc
That will clean the links if you’re on the same page automatically and put the anchor, with regards to the CSS, you will need to find a workaround when they’re in the same page because they have the assignment to use the “current page” class.
Best,
Juan.Best,
Juan.
You must be logged in to reply to this topic.