Detect scroll end for a page
<p>I have a div with position <code>fixed</code> and <code>top:96.9%</code>. I need to handle this <code>div</code> when the page reaches its end <em>(i.e when the page cannot be scrolled down further)</em>. How could I detect if the page scroll has reached its end? I did this:</p>

<pre><code>if( ($(window).scrollTop() + $(window).height()) == $(document).height()) {
   // No more scroll!
}
</code></pre>

<p>Is there a better way to detect this?</p>