- This topic has 7 replies, 2 voices, and was last updated 4 years, 3 months ago by
Leo.
-
AuthorPosts
-
August 11, 2019 at 8:11 am #981406
Shawn
Hi,
1) I’m using the menu decoration here https://docs.generatepress.com/article/adding-menu-hover-animation/
In the nav I also have a link to an anchor which lives in one of the other pages in the nav. All works great except when on that page both the parent and the anchor are underlined in the nav.
How can I have all links underline on hover but exclude the anchor from the current item underline?
2) Then on the off canvas panel I’m not using that effect, just background colour/text to indicate current. I also need to exclude the anchor from the current item change.
Thanks
August 11, 2019 at 4:05 pm #981625Leo
StaffCustomer SupportHi there,
1. Sorry I’m a little bit confused. Currently not seeing the hover animation. Have you decided against it?
Can you explain a bit more on what should happen and which menu item I should be looking at?
2. Looks like you’ve already done this?
Let me know π
August 11, 2019 at 10:18 pm #981732Shawn
Oh I’m so sorry. I made a change late last night and forgot to change it back. I’ve changed it now.
It’s active state underline. If you click on About then both it and the link to an anchor (Di Thompson) on the about page are underlined.
On desktop they’re underlined.
https://drive.google.com/file/d/1fnWU6jWdiIftSiGGaxlJjRz3HnvE9QbR/view?usp=sharingOn mobile they’re both highlighted
https://drive.google.com/file/d/1BfpaAvIHkUIvaBAP0KYHomEY_L0KxPP3/view?usp=sharingSo I basically need to exclude the active state from the Di Thompson link.
August 12, 2019 at 9:12 am #982189Leo
StaffCustomer SupportModify this block of CSS:
@media (min-width: 769px) { .main-navigation .menu > .menu-item.current-menu-item > a::after, .main-navigation .menu > .menu-item.current-menu-ancestor > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; }
to this:
@media (min-width: 769px) { .main-navigation .menu > .menu-item.current-menu-item:not(.menu-item-275) > a::after, .main-navigation .menu > .menu-item.current-menu-ancestor:not(.menu-item-275) > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; } }
August 12, 2019 at 9:26 am #982210Shawn
Brilliant. Thanks very much.
And how can I prevent the same item from being highlighted as current on the off canvas? It’s just the standard off canvas.
August 12, 2019 at 4:41 pm #982477Leo
StaffCustomer SupportTry this:
.slideout-navigation.main-navigation .main-nav ul li.menu-item-275[class*="current-menu-"] > a { background-color: transparent; color: #333; }
August 12, 2019 at 10:09 pm #982593Shawn
Perfect. Thanks so much. This is why I love GP
August 13, 2019 at 7:47 am #982927Leo
StaffCustomer SupportNo problem π
-
AuthorPosts
- You must be logged in to reply to this topic.