Debounce the mousescroll event

function debounce(method, delay) { clearTimeout(method._tId); method._tId= setTimeout(function(){ method(); }, delay); } $(window).scroll(function() { debounce(handleScroll, 100); });

Post a Comment

0 Comments