Scrolling back up does not trigger the previous highlight
-
Hey y’all!
I’m working on a page that has several large sections, each of which contains multiple rows. The key ids can each only go on one row, so there are id-less rows in between them. See mockup code below for clarity:
<div class=”row” id=”ch1″>
<h2>Chapter 1</h2>
</div>
<div class=”row”>
<p>Lorem ipsum</p>
</div>
<div class=”row” id=”ch2″>
<h2>Chapter 2</h2>
</div>As I scroll down from .row#ch1 into the row without id, the menu highlight for #ch1 remains highlighted. As I reach .row#ch2, the menu highlight for #ch2 becomes highlighted. This is the behavior I want – no problems here.
The problem occurs when I start to scroll /backwards/. If I jump to .row#ch2 and then scroll back into the row without id – which contains content belonging to Chapter 1 – the menu highlight for #ch2 remains highlighted. It’s as if it’s doing the same behavior in reverse: keep #ch2 highlighted until you reach .row#ch1.
Is there a way to set the settings so that I can scroll back up into a section and have that section’s top row id highlighted… without putting all of the Chapter 1 content into the one .row#ch1 row? (The content layout is complex and won’t work without multiple rows.) I’ve been digging through the documentation and while it helped me set up the initial behavior for scrolling down, I can’t find how to make it work scrolling up.
Thank you!
The topic ‘Scrolling back up does not trigger the previous highlight’ is closed to new replies.