Question

Well, the title says enough, jQuery - Detect if user can see the bottom of the page.

Important though is that I have to know it on page load.

So not "Has the user scrolled down to bottom of page?". Of course, JavaScript answer is fine :).

P.S. Isn't it weird that there isn't a tag "Page"?

EDIT: Isn't there like a variable where you can get the page height (regardless of the browser) and the window height (that the browser sees)? Then you could just use

if(window.height() < page.height()){
   //Do stuff
}
Was it helpful?

Solution

How about trying like this:-

if (($("#div").offset().top + $("#div").height()) >= $(window).height()) 
{
  //....
}

EDIT:-

Try this:-

 if($(document).height()>$(window).height()) 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top