title: Toggle Animate Div on Button Click
body: <p>I want to Toggle animate the Margin of a div on button click but doesn't seem to work. Here is the code and the fiddle link. I found the solution in one of the previous posts but still couldn't get it right.</p>
  
  <pre><code>$('button').click(function () {
      if ($('.demo').css('margin-top') == '0') {
          $('.demo').animate({
              marginTop: '-160px'
          }, 1000);
      } else {
          $('.demo').animate({
              marginTop: '0'
          }, 1000);
      }
  });
  </code></pre>
  
  <p><strong><a href="http://jsfiddle.net/vineetgnair/vmwratpf/" rel="nofollow">Fiddle</a></strong></p>
  
  <p>Thanks for help</p>