I have a handleScroll function that needs to be called when the scroll position of the window changes. Here is the code for this
$(window).scroll(handleScroll);
But the problem is that the above code ends up calling handleScroll too often. How to change the above code so that handleScroll is called only after the user has stopped scrolling for 200 milliseconds?
source share