title: IOS responsiveness
body: <p>I have a header and footer script here but when I scroll back up on IOS there is the scroll bouncing and it records last scroll as a down scroll and hides my header ( important to be shown at top = 0).</p>
  <p>What to do to give that condition to overrides this script?</p>
  <pre class="lang-js prettyprint-override"><code>jQuery.event.special.touchstart = {
    setup: function(_, ns, handle) {
      this.addEventListener('touchstart', handle, {
        passive: !ns.includes('noPreventDefault')
      });
    }
  };
  jQuery.event.special.touchmove = {
    setup: function(_, ns, handle) {
      this.addEventListener('touchmove', handle, {
        passive: !ns.includes('noPreventDefault')
      });
    }
  };
  var prevScrollpos = window.pageYOffset;
  window.onscroll = function() {
    var currentScrollPos = window.pageYOffset;
    if (prevScrollpos &gt; currentScrollPos) {
      document.querySelector(&quot;.header&quot;).style.top = &quot;0&quot;;
      document.querySelector(&quot;.navicon&quot;).style.top = &quot;8px&quot;;
      document.querySelector(&quot;.groupticket&quot;).style.top = &quot;6px&quot;;
      document.querySelector(&quot;.search&quot;).style.top = &quot;14px&quot;;
      document.querySelector(&quot;.foot&quot;).style.bottom = &quot;0px&quot;;
      document.querySelector(&quot;.filter&quot;).style.top = &quot;-50px&quot;;
    } else {
      document.querySelector(&quot;.header&quot;).style.top = &quot;-86px&quot;;
      document.querySelector(&quot;.navicon&quot;).style.top = &quot;8px&quot;;
      document.querySelector(&quot;.groupticket&quot;).style.top = &quot;6px&quot;;
      document.querySelector(&quot;.search&quot;).style.top = &quot;14px&quot;;
      document.querySelector(&quot;.foot&quot;).style.bottom = &quot;-201px&quot;;
      document.querySelector(&quot;.filter&quot;).style.top = &quot;0px&quot;;
    }
    prevScrollpos = currentScrollPos;
  }
  </code></pre>
  <p>I added this but it seems to mess with the script:</p>
  <pre><code>var idVar = setTimeout() =&gt; { 
    onscroll() 
  }, 1000);
  </code></pre>