title: scroll with to section using keyboard
body: <p>I am using this code to allow scroll using keyboard arrows, the issue is that its smooth going downwards but not upwards. I also want it to scroll to each section instead of holding down the arrow. is this possible?</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>$(document).keydown(function(e) {
    switch (e.which) {
      case 38: // up
        document.body.scrollTop -= 500;
        document.documentElement.scrollTop -= 500;
        break;
  
      case 40: // down
        document.body.scrollDown += 500;
        document.documentElement.scrollDown += 500;
        break;
  
      default:
        return; // exit this handler for other keys
    }
  });
  
  $(document).ready(function(){
    window.focus();
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body{
    height: 2000px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>