title: jQuery Calculate window yScroll position
body: <p>I'm trying to calculate they y position of the scrollbar dynamically as the window scrolls. I can get the initial scroll position on load using:</p>
  
  <pre><code>var scrollY = $(window).scrollTop();
  </code></pre>
  
  <p>But this doesn't update as the window scrolls around, I need to reload each time to get the updated variable. What do I need to do to keep this value updating as I scroll? I've tried something like:</p>
  
  <pre><code>$(document).scroll(function(e){
      $('#status').html(e.scrollY);
  });
  </code></pre>
  
  <p>And then created a div with and ID of 'status' to output the result, but I'm getting nothing. Can anyone assist with this?</p>
  
  <p>Thanks,
  Chris</p>