Reputation: 2202
How could I get an event when a div is scrolled to it's bottom? I need to append new data to the div when it is scrolled to the bottom.
Upvotes: 0
Views: 74
Reputation: 21406
You may use jQuery's .scroll()
event on window, like this:
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
$("#div_id").append("New Text");
}
});
Upvotes: 1