4

I want to call a specific function when the Scroll reaches at the Bottom END of the page.

Here is my Code m using but its not working for me. No console errors, but still not working.

$(function() {

    var scrollEnded = $.debounce(500, false, function() {

    console.log('scroll ended');

           alert("ok"); // I will call my function here. Just need an alert.

    });

});
Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Hassan Sardar
  • 4,413
  • 17
  • 56
  • 92

1 Answers1

4

Try this function

$(function(){
   $(window).scroll(function(){
       if($(document).height()==$(window).scrollTop()+$(window).height()){
           alert('I am at the bottom');
           // Here goes your code.
       }
   });
});

Check this JSFIDDLE

Umang Mehta
  • 1,467
  • 11
  • 16