title: debounce function means e.preventDefault on mousewheel no longer working
body: <p>I am chaging the background of the page using mousewheel. I only want to trigger the mousewheel event once 1000ms, so for that I am using a debounce function.</p>
  
  <p>Before I added the debounce function and used <code>e.preventDefault()</code> it prevented the scroll from working. However, now that I have added the debounce function this no longer works and the user can scroll the page again.</p>
  
  <p>Please see code below.</p>
  
  <pre><code>$(document).ready(function() {
      $(document).on('mousewheel DOMMouseScroll',debounce(function(e){
          e.preventDefault();
          //code to change the background image
      }, 1000))
  });
  
  function debounce(fn, delay) {
    var timer = null;
    return function () {
      var context = this, args = arguments;
      clearTimeout(timer);
      timer = setTimeout(function () {
        fn.apply(context, args);
      }, delay);
    };
  </code></pre>