jQuery to fadeIn and fadeOut based upon scroll
<p>I'm using the following to change an element's opacity from 0 to 1 based upon the number of pixels they have scrolled and it works perfectly.</p>

<pre><code>$(window).scroll(function() {
  if ($(this).scrollTop() &gt; 200) {
      $("#hook").stop().animate({
          opacity: 1
      }, 300);
  } else {
      $("#hook").stop().animate({
          opacity: 0
      }, 300);
  }
});
</code></pre>

<p>What I would like to add is something that says, "when the user has scrolled 500 pixels or more, fade it back out."</p>
