B
B
Breeze12020-04-13 15:16:51
JavaScript
Breeze1, 2020-04-13 15:16:51

Add class when block is in scope?

Is there something like a vertical timeline

Example
5e9458274735e171235734.png


Example https://codepen.io/brezze/pen/VwvLBvY

When scrolling for a menu element, add an active class that corresponds to the block, and remove it from the previous one. How it is better to implement it?

I understand that you need to check when the content part is in the viewport, then add a class for the corresponding menu item, I just don’t fully understand how to implement it yet.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question