Skip to content

Instantly share code, notes, and snippets.

@kevonc
Forked from tibbon/gist:6222633
Last active December 21, 2015 00:48
Show Gist options
  • Save kevonc/6222682 to your computer and use it in GitHub Desktop.
Save kevonc/6222682 to your computer and use it in GitHub Desktop.
easy infinite scroll
$(window).scroll(function() {
// Cache our jQuery selector for window
var win = $(window);
// Infinite scroll math!
if(win.height() + win.scrollTop() >= $(document).height()) {
populateCountries();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment