title: How do I cleanly animate something sideways in Javascript?
body: <p>I'm trying to get the divs to animate slowly sideways is this possible with JavaScript I'm pretty new to this and any help would be appreciated.</p>
  <p>The code is here:</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>if(window.location.hash) {
      var hash = window.location.hash;
      $('div').hide();
      $(hash).show();
  }
  
  $(window).on('hashchange', function() {
      var hash = window.location.hash;
      $('div').hide();
      $(hash).show();
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>div {
      display: block;
      width: 100px;
      height: 100px;
      display: none;
  }
  
  #blue {
      background: blue;
  }
  
  #red {
      background: red;
  }
  
  #green {
      background: green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;a href="#blue"&gt;Show Blue&lt;/a&gt; | &lt;a href="#red"&gt;Show Red&lt;/a&gt; | &lt;a href="#green"&gt;Show Green&lt;/a&gt;
  
  &lt;div id="blue"&gt;&lt;/div&gt;
  &lt;div id="red"&gt;&lt;/div&gt;
  &lt;div id="green"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>The fiddle is here <a href="http://jsfiddle.net/aUsHh/3/" rel="nofollow noreferrer">http://jsfiddle.net/aUsHh/3/</a></p>