Q
Q
qwerty17772018-03-15 16:30:21
css
qwerty1777, 2018-03-15 16:30:21

How in React when scrolling, change the css class properties?

It is necessary in React to reduce the size of the header when scrolling down and, accordingly, when scrolling to the end to the top, restore the reverse css values ​​\u200b\u200bof a certain class. And can this be done with the react-scroll library?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bugagashnik, 2018-03-15
@bugagashnik

There are many scroll libraries on github. When you scroll to a certain point, just add a class to the element or change the inline style. I don’t remember exactly, but it seems that react-scroll has a scroll hook to the element (div). Read the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question