title: jQuery scroll event fire once per scroll
body: <p>I have some jQuery code to check if I've scrolled to the bottom of the window.</p>
  
  <pre><code>$(window).scroll(function(){
      if($(window).scrollTop() + $(window).height() == $(document).height()) {
          appendToGrid();
      }
  })
  </code></pre>
  
  <p>My appendToGrid() function scrolls the user to the top of the page and adds content. Problem is, I need this function called once per scroll. As I have it now, it is called multiple times per scroll.</p>
  
  <p>If I change it to</p>
  
  <pre><code>$(window).one('scroll',function() {
      if($(window).scrollTop() + $(window).height() == $(document).height()) {
          appendToGrid();
      }
  });
  </code></pre>
  
  <p>it will only fire once total, but I need it to fire once per scroll so the user can scroll to the bottom and keep getting sent back to the top of the page.</p>
  
  <p>I've also tried the below but it still fires multiple times.</p>
  
  <pre><code>var fired = false;
  $(window).scroll(function(){
      if($(window).scrollTop() + $(window).height() == $(document).height() &amp;&amp; !fired) {
          fired = true;
          appendToGrid();
          fired = false;
      }
  })
  </code></pre>