jQuery window scroll event does not fire up
Solution 1:
Your CSS is actually setting the rest of the document to not show overflow therefore the document itself isn't scrolling. The easiest fix for this is bind the event to the thing that is scrolling, which in your case is div#page
.
So its easy as changing:
$(document).scroll(function() { // OR $(window).scroll(function() {
didScroll = true;
});
to
$('div#page').scroll(function() {
didScroll = true;
});
Solution 2:
My issue was I had this code in my css
html,
body {
height: 100%;
width: 100%;
overflow: auto;
}
Once I removed it, the scroll event on window fired again
Solution 3:
$('#div').scroll(function () {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight-1) {
//fire your event
}
}