Answer the question
In order to leave comments, you need to log in
How to calculate the scroll step?
What are the solutions to calculate the scroll step (difference between the previous and next value). It doesn't matter how the page scrolls with the mouse wheel or in any other way.
Answer the question
In order to leave comments, you need to log in
var $win = $(window), $doc = $(document), prevPoint = $win.scrollTop();
$doc.scroll(function(){
var curScroll = $win.scrollTop();
console.log( curScroll - prevPoint );
prevPoint = curScroll;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question