Detect scroll to bottom of DIV

I want to detect that I am getting to the bottom of the div my div is 400px height with overflow I don't know the normal height but over 400px

I am using this code but it doesn't work any idea?

if($("#article-txt").scrollTop() + $("#article-txt").height() == $("#article-txt")[0].scrollHeight) {



source to share

1 answer

    if($(this)[0].scrollHeight - $(this).scrollTop() === $(this).outerHeight()) {


Works. You need to add the parent div name and not scroll the Div yourself.



All Articles