Check if a user has scrolled to the bottom (not just the window, but any element) [duplicate]

I’m making a pagination system (sort of like Facebook) where the content loads when the user scrolls to the bottom. I imagine the best way to do that is to find when the user is at the bottom of the page and run an Ajax query to load more posts.

The only problem is I don’t know how to check if the user has scrolled to the bottom of the page. Any ideas?

I’m using jQuery, so feel free to provide answers that use it.

3Best Answer
31

Leave a Comment