I have a function handleScroll which needs to be called when the window’s scroll position changes. Here is the code for that
$(window).scroll(handleScroll);
But the problem is that above code ends up calling handleScroll too frequently. How can I modify the above code so that handleScroll is only called after the user has stopped scrolling for 200 milliseconds?
1 Answer