Prevent scrollTop from calling scroll event
<p>I'm trying to create this behavior: when user scrolls a mousewheel (or presses <kbd>↓</kbd>) the webpage is scrolled down by the height of the window.</p>

<p>I've ended up with following code:</p>

<pre><code>var newScrollTop,
    oldScrollTop = $(window).scrollTop(),
    preventScroll = false;
$(window).scroll(function() {
    if (!preventScroll) {
        preventScroll = true;
        newScrollTop = $(this).scrollTop();
        if (newScrollTop &gt; oldScrollTop) {
            $(this).scrollTop( oldScrollTop + $(window).height() );
        }
        else {
            $(this).scrollTop( oldScrollTop - $(window).height() );
        }
        oldScrollTop = newScrollTop;
        preventScroll = false;
    }
});
</code></pre>

<p>But this doesn't work as I expect it: on scroll event page is scrolled to the very edge (bottom or top). What am I missing?</p>
