JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<div id="posts">
<div id="posts_content">Stuff
</div>
</div>
CSS
#posts { overflow-y: scroll; height: 300px; }
#posts_content { height: 2000px; }
div { border: solid 1px #ddd; }
JavaScript
$("#posts").scroll(function() {
if($(this).scrollTop() >= ($("#posts_content").outerHeight() - $(this).height() - 40)) {
alert("Reached Bottom!");
}
});