title: jQuery on scroll toggle between two classes
body: <p>By default I have a navigation bar which has a red background color.</p>
  
  <p>What I want to do is when the users scrolls down more than 100px to change the background to blue and if he goes back to 0px to change the background to it's default state.</p>
  
  <p>I want to do this by toggling between two classes, for example  <code>&lt;div class="navigation red"&gt;</code> should be the default class and if the user scroll down to add  <code>&lt;div class="navigation blue"&gt;</code> and if he scrolls back to have  <code>&lt;div class="navigation red"&gt;</code> again.</p>
  
  <p>Here is my attempt : </p>
  
  <pre><code>$(document).ready(function(){
    $(window).scroll(function(){
      if ($(window).scrollTop() &gt; 100){
          $('.navigation').toggleClass( "blue");
      }
   });
  });
  </code></pre>
  
  <p>But this is not working. Here's a <a href="http://jsbin.com/bifabixelaci/2/" rel="nofollow">jsbin</a>.</p>
  
  <p>Any ideas how to get it to work ? </p>