title: Hide Menu on scroll down show on scroll up - issue with Safari
body: <p>I have an issue with JS - &quot;hide menu on Scroll Down, Show on Scroll Up&quot; and its optimalization on Safari.</p>
  <p>The menu works on all browsers except Safari where it disappears on the top because of the top bounce.</p>
  <p>Here is the JS code:</p>
  <pre><code>var lastPosition = 0;
  $(document).ready(function(){
    $(window).on('scroll', function(){
  
      $('header').toggleClass('hide', $(window).scrollTop() &gt; lastPosition);
      lastPosition = $(window).scrollTop();
  
  });
  </code></pre>
  <p>I dont want fixed menu I would be glad to hear any suggestions.</p>
  <p>Thank you very much,</p>
  <p>Barbora</p>