jQuery scrollTop is not equal to scrollHeight at the bottom of div
<p>I am adding components in a div dynamically. I want to load more contents why croll bar is at the end (what usually social media sites do these days). I have written following code for it:</p>

<pre><code>$('.tabs-body-container #tbody-0 .feeds').scroll(function () {
    if (!invoked_next) {
        cont_height = $(this).get(0).scrollHeight;
        scrl_pos = $(this).scrollTop();
        if (scrl_pos / cont_height &gt;= .70) {
            invoked_next = true;
            loadData();
        }
    }
});
</code></pre>

<p>But when I scroll down the bar and brings it to end the value of scrl_pos and cont_height have a lot of difference. The lower amount of contents I load the higher the difference in percentage. Can anybody help me find all possibilities to check and find the reason?</p>

<p>Thanks</p>
