Differentiate between scroll up/down in jquery? [duplicate]

Check for the last state. Something like this:

Keep a variable, say, last_scroll_position, and when you have a scroll, if last_scroll_position - current_position > 0, the user scrolled up, and down if it’s less than 0.

Leave a Comment