title: Prevent a scroll function to trigger on click
body: <p>I have an autohiding header, which hides on scroll down and shows up again on scroll up. I also have two navigation arrows, which allows you to go up and down between sections. The problem though, is when clicking the up-arrow, the menu shows because the site scrolls up. 
  So what I'm trying to figure out, but not really can, is how to prevent the autohiding functions to be called when clicking the up-arrow. </p>
  
  <p>This is what triggers the hiding function, which I don't want to be triggered if we are scrolling up when we clicked the up-arrow: </p>
  
  <pre><code>//set scrolling variables
  var scrolling = false,
      previousTop = 0,
      currentTop = 0,
      scrollDelta = 10,
      scrollOffset = 150;
  
  $(window).on('scroll', function(){
      if( !scrolling ) {
          scrolling = true;
          (!window.requestAnimationFrame)
              ? setTimeout(autoHideHeader, 250)
              : requestAnimationFrame(autoHideHeader);
  
      }
  });
  </code></pre>
  
  <p>And this is the arrow-code:</p>
  
  <pre><code>var sections = $('.panel-section');
  console.log(sections);
  var i =0;
  var scrolto = 0;
  
  function next(){
  
      if(i == 0){
          $('.prev-section').show();
      }
      if(i &lt; sections.length -1){
          i++;
          if(i == sections.length -1){
              $('.next-section').hide();
          }
          $('html, body').animate({
              scrollTop: sections[i].offsetTop
          }, 2000);
      }else{
          alert('end reached');
      }
  }
  function prev(){
      if(i == sections.length -1){
          $('.next-section').show();
      }
      if(i &gt; 0){
          i--;
          if(i == 0){
              $('.prev-section').hide();
          }
          $('html, body').animate({
              scrollTop: sections[i].offsetTop
          }, 2000);
      }
  }
  $('html').keydown(function(e){
      if(e.which == '38'){
          prev();
      }
      if(e.which == '40'){
          next();
      }
  });
  $('.next-section').click(function(e){
      e.preventDefault();
      next();
  });
  
  $('.prev-section').click(function(e){
      e.preventDefault();
      prev();
  });
  </code></pre>
  
  <p>I think this is the only relevant code, but I might be wrong and if so, I can provide with more. </p>