The following code is used to determine if the user scrolls at the bottom of the page and works.
if($(window).scrollTop() == $(document).height() - $(window).height()){
}
Problem:
I don’t understand why you subtract the height of the window from the height of the document, and then compare it with the scroll height to determine if the bottom of the page is reached. Why is it not easy
if($(window).scrollTop() == $(document).height()){
}
or
if($(window).scrollTop() == $(window).height()){
}
source
share