Archived topic
Smooth scroll current menu item highlighting
2 replies · Started by George on May 7, 2020
I am using smooth scroll for a one-page website for the nav links and I am trying to have the active nav links highlighted. I am using the gist provided by Tom found in this thread:
https://generatepress.com/forums/topic/page-scroll-to-id-to-highlight-current-element-on-sticky-nav/#post-251333
It seems to be working but sometimes multiple links are being highlighted at the same time. Is there a parameter I could change to make it work?
Ok, I will answer my own question. Changing
secPosition = secPosition - 135;
to this
secPosition = secPosition - 220;
seems to have solved the issue.
Sorry about that!
Glad you found the solution - thanks for sharing it! :)