title: jQuery Animation Toggle
body: <p>This is a pretty straight-forward problem. I basically have a div block on a page that, when clicked, grows in size, and when clicked again returns back to what it was. My problem is that it just doesn't seem to work at all. Plus, I'm sure there is a much cleaner way to toggle between two animation states than an if statement like this, but I'm not sure how exactly to go about doing that.</p>
  
  <pre><code>$(document).ready(function(){
      var toggle = 0;
      $(".login").click(function(){
          if($toggle == 0){
              $(this).animate({
                  height: '200',
              }, 500, function(){
              });
              $toggle = 1;
          }
          else if($toggle == 1){
              $(this).animate({
                  height: '100',
              }, 500, function(){
              });
              $toggle = 0;
          }
      });
  });
  </code></pre>
  
  <p>Corresponding html code is simply</p>
  
  <pre><code>&lt;div class="login"&gt;Click Me&lt;/div&gt;
  </code></pre>
  
  <p>Let me know if anything else is needed.</p>