title: Reset div to original position
body: <p>When I click on reset button I want the box to go to its original position at top left. I tried using animate but its not working. I need to have the animate and queue function.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#start").click(function() {
    $("div")
      .show("fast").animate({
        left: "+=200"
      }, 5000).queue(function() {
        $(this).addClass("newcolor").dequeue();
      }).animate({
        top: '+=0'
      }, 2000).queue(function() {
        $(this).addClass("newcolor").dequeue();
      }).animate({
        top: '+=100'
      }, 5000).queue(function() {
        $(this).addClass("newcolor").dequeue();
      }).animate({
        left: '-=200'
      }, 5000).queue(function() {
        $(this).addClass("newcolor").dequeue();
      }).animate({
        top: '-=100'
      }, 5000).queue(function() {
        $(this).addClass("newcolor").finish();
      })
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    border: 1px solid blue;
    width: 237px;
    height: 167px;
  }
  
  div {
    margin: 7px;
    width: 40px;
    height: 40px;
    position: absolute;
    left: 0px;
    top: 30px;
    background: green;
    display: none;
  }
  
  div.newcolor {
    background: blue;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;button id="start"&gt;Start&lt;/button&gt;
  &lt;button id="reset"&gt;Reset&lt;/button&gt;
  &lt;div&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="http://jsfiddle.net/1vosy3gr/" rel="nofollow noreferrer">My JSFiddle</a></p>