E
E
ettge2017-04-26 22:12:20
JavaScript
ettge, 2017-04-26 22:12:20

How to listen to scroll up and add a class?

I make a function when the Header is hidden at a certain moment of scrolling down (in the example 250px), and I need it to be shown back on any scroll up movement (and not again when this point is reached 250px).
How can I make it so that when the user scrolls up, for example by 50px, a trigger fires and adds the headroom--pinned class (or removes headroom--unpinned)?
https://codepen.io/kodekrendel/pen/XRpXej

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-04-26
@ettge

https://codepen.io/anon/pen/jmyqMV?editors=0010#0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question