title: reduce number of calls for .resize and .scroll methods
body: <p>I'm using the following code to find out which part of the page the viewer is visiting (something like google books, to find out the page that's being viewed) :</p>
  
  <pre><code>$("#main-content").scroll(function () { 
              Nx.curPage = (Math.round($(this).scrollTop()/620)+1);
              window.location.hash = "#"+Nx.curPage;
              Nx.select(undefined);
          });
  </code></pre>
  
  <p>also in another part I use <code>$(window).resize( ... )</code> to fit my content in current window size, which is called for every single resize . as you can imagine this slows down the page alot, specially on older hardwares. Is there any way to realise when scrolling or resizing is stopped and then start doing the stuff, so number of processes is reduced ? something like <code>$("#main-content").scrollStop</code> ???</p>