title: Infinite scroll and sorting issue
body: <p>I'm using the following JavaScript to do an infinite scroll and sorting:</p>
  
  <pre><code>$(window).scroll(function () {
    if ($(window).scrollTop() + $(window).height() == $(document).height()) {
      if (!busy) {
        busy = true;
        $('#spinner').show();
        // AJAX call and append list
        $('#spinner').hide();
        busy = false;
      }
    }
  }); 
  $('#sort').on('change', function () {
    // AJAX call and replace list
  });
  </code></pre>
  
  <p>But the problem I'm having, is when sorting the scroll function is also fired, which results in 2 AJAX calls and adding more results to the list than expected.</p>
  
  <p>How do I prevent the scroll function from firing when doing a sort on my list?</p>
  
  <p><strong>Update</strong></p>
  
  <p>A simple example. First scroll down, then do a sort which will result in two alerts.</p>
  
  <p><a href="https://jsfiddle.net/bsLg7jaw/13/" rel="nofollow noreferrer">JSFiddle example</a></p>