title: Jquery mousescroll registers twice if scrolling too fast
body: <p>To Cut to the chase - I have a page where if you scroll up or down it automatically moves to the next div position. When you scroll, it picks up on the scroll event and temporarily disables it to allow for only one scroll at a time so that it doesnt jump pages.</p>
  
  <p>I'm using a jquery mousewheel plugin to pick up on the scroll events</p>
  
  <p>I'm using this code: </p>
  
  <pre><code>$('body').mousewheel(function(event, delta) {
  
              if(delta &lt; 0 &amp;&amp; page &lt; 3){
                      page++;
                      scrollToPage(true);
                  }else if(delta &gt; 0 &amp;&amp; page &gt; 0){
                      page--;
                      scrollToPage(true);
                  }
  
      });
  </code></pre>
  
  <p>Now the problem here is that on a scroll event it registers the eventlistener a dozen times almost instantly, i only want it to register once for each scroll push.</p>
  
  <p>So I Tried this:</p>
  
  <pre><code>var allowScroll = true;
  
  $('body').mousewheel(function(event, delta) {
  
              if(allowScroll == true){
  
                  allowScroll = false;
  
                  if(delta &lt; 0 &amp;&amp; page &lt; 3){
                      page++;
                      scrollToPage(true);
                  }else if(delta &gt; 0 &amp;&amp; page &gt; 0){
                      page--;
                      scrollToPage(true);
                  }
              }
  
      });
  </code></pre>
  
  <p>now this worked great if you scroll with a mouse, but if you scroll with a track pad then it would register the event too quickly and would run twice before allowScroll turns to false.</p>
  
  <p>I also tried using the     </p>
  
  <pre><code>$.off()
  </code></pre>
  
  <p>function.. also didnt work. </p>
  
  <p>Any guidance?
  Thanks</p>