title: Javascript onscroll function not working
body: <p>I am trying to add a <code>class</code> to a <code>id</code> when the user scrolls past 25 pixels. I am unsure why but the function is not firing after I school. Any help as to why would be greatly appreciated. Here is my code:</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>window.onscoll = function() {
    showArrow()
  };
  
  function showArrow() {
    if (document.body.scrollTop &gt; 25 || document.documentElement.scrollTop &gt; 25) {
      document.getElementById("hide_Arrow").className = "show";
    } else {
      document.getElementById("hide_Arrow").className = "";
    }
  }
  console.log(arrow);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#arrow {
    position: relative;
    height: 270px;
    display: block;
    margin: -20px auto;
    overflow: hidden;
  }
  
  #hide_Arrow {
    height: 0px;
    margin: -200px 00px 0px 0px;
    overflow: hidden;
  }
  
  #hide_Arrow.show {
    height: 250px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="hide_Arrow"&gt;
    &lt;img id="arrow" src="media/Arrow_down.png" alt="Arrow Down"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>