Skip to content

Instantly share code, notes, and snippets.

@nickpelton
Created February 7, 2014 20:50
Show Gist options
  • Select an option

  • Save nickpelton/8871572 to your computer and use it in GitHub Desktop.

Select an option

Save nickpelton/8871572 to your computer and use it in GitHub Desktop.
JS debounce issue
setTimeout(function(){
$(window).on('scroll',function(){
console.log('Scroll!');
if($(window).scrollTop() + $(window).height() > $(document).height() - 10){
// loadPosts();
_.debounce(loadPosts(),1000);
}
});
},2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment