Disable scrolling for 0.5 seconds after the user scrolls once in JavaScript
<p>I have a resizing header with <code>heigth:100%</code>. I need to disable scrolling for <em>0.5 seconds</em> after the user scrolls once. Is there any way to do that in JavaScript ?</p>

<p><strong>Here is my code:</strong></p>

<pre><code>&lt;script&gt;
    function init() {
        window.addEventListener('scroll', function(e){
            var distanceY = window.pageYOffset || document.documentElement.scrollTop,
                shrinkOn = 50,
                header = document.querySelector("header");
            if (distanceY &gt; shrinkOn) {
                classie.add(header,"smaller");         
            } else {
                if (classie.has(header,"smaller")) {
                    classie.remove(header,"smaller");
                }
            }
        });
    }
    window.onload = init();
&lt;/script&gt;
</code></pre>