title: when scroll bottom to top header is sticky
body: <p>When top scroll is top less than limit bottom and bottom to top scroll Header is Sticky.</p>
  
  <pre><code>var lastScroll = 0;
  
  $(document).ready(function($) {
  
  $(window).scroll(function(){
  setTimeout(function() { 
  var scroll = $(window).scrollTop();
  if (scroll &gt; lastScroll) {
  
      $("header").removeClass("menu-sticky");
  
  } 
  if (scroll == 0) {
  $("header").removeClass("menu-sticky");
  
  }
  else if (scroll &lt; lastScroll - 5) {
  
  
      $("header").addClass("menu-sticky");
  
  }
  lastScroll = scroll;
  },0);
  });
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/memdumusaib/d52xcLm3/" rel="nofollow noreferrer">https://jsfiddle.net/memdumusaib/d52xcLm3/</a></p>