You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When scrolling down the page, the first navigation entry is correctly activated, but everything from the second entry on jumps immediately to the following entry once the page is scrolled past the section's top edge. The same happens when scrolling back upwards. It can be easily seen that the second navigation entry is only activated for a very short vertical range.
I noticed that you applied the hash ID to an element that spans the entire section, not just its top, like for example an <h1> element. And that the code registers each section's top and bottom offset, instead of simply the top. But even when I change my document structure to match your demo, that doesn't help.
Looking for solutions in the source code now, as I don't expect any help here, considering the other long-open issues.
The text was updated successfully, but these errors were encountered:
Oh, that was tricky. I'm also using the owl carousel, and had initialised that after the scrollspy. So scrollspy would scan the page, remember each tops and bottoms, and then came the carousel and modified the element heights. Once I turned the two around, the scrollspy would work fine.
But one thing remains: If any element on the page changes its height after scrollspy has been initialised, all following scrolling offsets will be wrong (outdated) and that thing essentially fails.
ygoe
changed the title
Activating the wrong element
Activating the wrong element after layout change
Aug 6, 2017
When scrolling down the page, the first navigation entry is correctly activated, but everything from the second entry on jumps immediately to the following entry once the page is scrolled past the section's top edge. The same happens when scrolling back upwards. It can be easily seen that the second navigation entry is only activated for a very short vertical range.
I noticed that you applied the hash ID to an element that spans the entire section, not just its top, like for example an
<h1>
element. And that the code registers each section's top and bottom offset, instead of simply the top. But even when I change my document structure to match your demo, that doesn't help.Looking for solutions in the source code now, as I don't expect any help here, considering the other long-open issues.
The text was updated successfully, but these errors were encountered: