문제

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
}
도움이 되었습니까?

해결책

How about trying like this:-

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

EDIT:-

Try this:-

 if($(document).height()>$(window).height()) 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top