title: How to animate an object depending on page scroll position
body: <p>I am currently using the following code to display/hide content based on the current scroll position:</p>
  
  <pre><code>$(window).scroll(function () {
      if ($(window).scrollTop() &gt;= 409) {
          $('.cliocont').fadeTo('slow', 1.0);
      } else if ($(window).scrollTop() &lt;= 409) {
          $('.cliocont').fadeTo('slow', 0.5);
      }
  });
  </code></pre>
  
  <p>Is there a reason why this code does not seem to work? Whenever the else if statement the code works, but whenever it is added the content doesn't appear or hide.</p>
  
  <p>Thanks,
  Nathan Niamehr</p>