2
$(window).scroll(function(){
  if(window.reachBrowserBottom) {
    alert('browser bottom reached');
  }
}

I want to trigger an event when browser scrolling reaches the bottom. To load more content, much like sites like Facebook or Quora do it.

I tried:-

var bottomReached =  $(window).height() = $(window).scrollTop();
if(bottomReached) {
   ...
}

But bottomReached is a bit unpredictable.

Sangram Singh
  • 7,161
  • 15
  • 50
  • 79
  • possible duplicate of [How to check if a user has scrolled to the bottom](http://stackoverflow.com/questions/3898130/how-to-check-if-a-user-has-scrolled-to-the-bottom) – Timespace Apr 21 '15 at 12:57

1 Answers1

3

Check out this answer. It addresses the same issue.

https://stackoverflow.com/a/3898152/1341823

You need to use the .scroll() event on window.

Community
  • 1
  • 1
Sanjay
  • 291
  • 1
  • 3
  • 13
  • 1
    @SangramSingh You could also check out the wonderful Infinite Scroll jQuery plugin by Paul Irish. http://www.infinite-scroll.com/ – Sanjay Nov 16 '13 at 08:29