title: JavaScript trouble detecting mouse wheel event
body: <p>I'm trying to capture the mouse event. Here is the code I'm trying: </p>
  
  <pre><code>if(window.addEventListener) { document.addEventListener('DOMMouseScroll', zoom_handler, false); } 
  else { document.onmousewheel = zoom_handler; }
  
  alert("test"); //I see this alert so I assume the code above it is run
  </code></pre>
  
  <p>//...</p>
  
  <pre><code>function zoom_handler(event) {
  
      var delta = 0;
  
      if (!event) event = window.event;
      // normalize the delta
      if (event.wheelDelta) {
          // IE and Opera
          delta = event.wheelDelta / 60;
      } else if (event.detail) {
          // W3C
          delta = -event.detail / 2;
      }
  
      alert("Delta: " + delta);
  
  
  }
  </code></pre>
  
  <p>Except the problem is I see nothing when I try wheeling up and down on my page, so I guess I'm not capturing the event properly. For reference, I've been trying to follow this tutorial: <a href="http://viralpatel.net/blogs/2009/08/javascript-mouse-scroll-event-down-example.html" rel="nofollow">http://viralpatel.net/blogs/2009/08/javascript-mouse-scroll-event-down-example.html</a></p>
  
  <p>Thanks for any help.</p>