What problems did you encounter while trying to write this? Here's a jsFiddle example based on the first result that I found on Google for "jquery check if div div scrolls from bottom to bottom". It seems to be working fine.
http://jsfiddle.net/QB75Z/
And here is the link to the found article: http://www.yelotofu.com/2008/10/jquery-how-to-tell-if-youre-scroll-to-bottom/
EDIT . Here's the actual code from jsFiddle that I posted, in case someone searches and jsFiddle disappears. Have a scrollable div (give it a height and overflow-y: scroll
) with scrollable id and inner div inside that with inner class. You can then determine if the div is scrolling down or not using the following code:
var scrollable = $('#scrollable'); var inner = $('#scrollable > .inner'); // check if div is scrolled to bottom before addition of new content var atBottom = Math.abs(inner.offset().top) + scrollable.height() + scrollable.offset().top >= inner.outerHeight(); // add additional content to .inner here if ( atBottom ) { // do stuff like scroll to bottom etc }
source share