Skip to content Skip to sidebar Skip to footer

Detect Scroll To Bottom Of A Div

i want to detect that i reach the bottom of a div my div is 400px height with overflow hidden i don't know the normal height but more than 400px i'm using this code but it doesn't

Solution 1:

$("#parentdiv").scroll(function(){
    if($(this)[0].scrollHeight - $(this).scrollTop() === $(this).outerHeight()) {
        alert(1);
    };
});

Works. You need to add the parent div name, not the scrolling Div itself.


Post a Comment for "Detect Scroll To Bottom Of A Div"