F
F
frayer2021-06-19 13:21:59
css
frayer, 2021-06-19 13:21:59

How to make a menu appear when scrolling down?

Hello, tell me how to make a vertical menu appear when scrolling down with the active class, which changes when you switch to another section,
An example is on the site https://www.marco.fyi

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dyusha Metelkin, 2021-06-19
@frayer

You track the scroll event and, for example, if you scroll more than 500, add the block class

(window.pageYOffset > 500){
      navigation.classList.add('block')
in order to keep track of which section you are in, there is a poke

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question