title: Only the topmost code in $(window).scroll is working
body: <p>I've got some code in <code>$(window).scroll</code> that checks if an element is visible, then triggers another function.</p>
  
  <p>However, only the first section of code is firing. Both bits of code work in and of themselves - if I swap their order, whichever is on top fires correctly.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>$.fn.isOnScreen = function() {
   "use strict";
   var win = $(window), viewport = {
    top: win.scrollTop(),
    left: win.scrollLeft()
   }, bounds = this.offset();
   viewport.right = viewport.left + win.width();
   viewport.bottom = viewport.top + win.height();
   bounds.right = bounds.left + this.outerWidth();
   bounds.bottom = bounds.top + this.outerHeight();
   return !(viewport.right &lt; bounds.left || viewport.left &gt; bounds.right || viewport.bottom &lt; bounds.top || viewport.top &gt; bounds.bottom);
  };
  
  $(window).scroll(function() {
   "use strict";
  
   var load_more_results = $("#ajax-load_more_results").isOnScreen();
   if (load_more_results === true) {LoadMoreResults();}
  
   var load_more_staff = $("#ajax-load_more_staff").isOnScreen();
   if (load_more_staff === true) {LoadMoreStaff();}
  });
  </code></pre>
  
  <p>What am I doing wrong? Can you only fire one event from <code>$(window).scroll</code>? I assume not.</p>