title: jquery : detecting scroll position
body: <p>I want to get an alert when, while scrolling, my footer comes to view.</p>
  
  <pre><code>$(window).on("mousewheel", function(){
      if ($(window).scrollTop() + $(window).height() &gt; $('#footer').position().top){    
          alert("footer visible");
      }  
      else{
          alert("footer invisible");  
      }
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/JRUnr/10/" rel="nofollow noreferrer">http://jsfiddle.net/JRUnr/10/</a></p>
  
  <p>All conditions with height seem right, but not during scrolling.</p>