title: I've got a problem with a toggling sidebar using jQuery
body: <p>I'm trying to create a simple toggling sidebar using jquery, where it expands and contracts when a button is pressed. The button also changes to another type of button when pressed. The sidebar will expand, but for some reason, it will not move back to it's original position. 
  You can see a copy of the javascript and html at <a href="http://www.jqueryhelp.com/viewtopic.php?p=4241#4241" rel="nofollow noreferrer">http://www.jqueryhelp.com/viewtopic.php?p=4241#4241</a></p>
  
  <p>Here is the working code, thanks Bendeway! :D</p>
  
  <pre><code>$(".btn-slide").live('click', function(e){ 
     e.preventDefault();
  
     $("#sidebar").animate({opacity: "show", left: 250}, "slow"); 
     $(this).toggleClass("btn-slide").toggleClass("active");
  }); 
  
  $(".active").live('click', function(e){ 
     e.preventDefault();
  
     $("#sidebar").animate({opacity: "hide", left: 100}, "slow"); 
     $(this).toggleClass("btn-slide").toggleClass("active");
  });
  </code></pre>