title: jquery document height and window height
body: <p>I have a problem with following jquery code</p>
  
  <pre><code>if ($(window).scrollTop() &gt;= ($(document).innerHeight() - $(window).innerHeight())) 
  </code></pre>
  
  <p>In Google chrome the code is working perfectly but in Firefox or IE it doesn't.
  There's any way to rewrite it ?</p>
  
  <p>Thank you!</p>
  
  <p>EDIT:</p>
  
  <p>After some debug.. the value of document height - window height is bigger than "window.scrollTop" so the following code is a possible fix</p>
  
  <pre><code>if ($(window).scrollTop() &gt;= ($(document).innerHeight() - $(window).height() - 2)) {
  </code></pre>