Highlight active item when navigation reaches top of each section
-
Hi,
Plugin works great so far. I’ve set it up like the following:
and this is the CSS I wrote:
#ps2id-dummy-offset{ height: 155px; } a.__mPS2id._mPS2id-h.mPS2id-highlight { color: var(--c-active) !important; } a.__mPS2id._mPS2id-h.mPS2id-highlight:before { width: 100% !important; } .mPS2id-target-last{ color: var(--c-active) !important; }
However, I was wondering if it’s possible to make it so that the links only change the highlighted class when the sticky navigation bar reaches the top of the following section. Here’s a video of how the setup looks on my page so far:
As you can see in the video, when the “Our History” section just barely comes into view, the link “History” becomes highlighted. The effect I was hoping for is to have the link “History” become highlighted when the fixed navigation bar just reaches that “Our History” section, and not before (or not when it scrolls into view). Sort of like this: https://codepen.io/BraisC/pen/mxVwVm
- The topic ‘Highlight active item when navigation reaches top of each section’ is closed to new replies.