Skip to content

Instantly share code, notes, and snippets.

@qelli
Forked from toshimaru/jquery-scroll-bottom.js
Created May 16, 2019 18:33
Show Gist options
  • Select an option

  • Save qelli/6a19f1d77d4ac08431efdf4f6bf5af4e to your computer and use it in GitHub Desktop.

Select an option

Save qelli/6a19f1d77d4ac08431efdf4f6bf5af4e to your computer and use it in GitHub Desktop.
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment