I'm attempting to load data as the page is scrolled, and for this purpose I am using the following function:
$(window).scroll(function ()
{
if($(document).height() <= $(window).scrollTop() + $(window).height())
{
alert("done")
}
});
The issue arises when my page setup involves setting body overflow to hidden and having a scrollable container. In this scenario, the code above doesn't work. However, it works fine when I enable body scroll. Can anyone provide suggestions on how to address this problem?
Check out the JSFiddle demo here.