I currently have this piece of code:
canvas.onmousewheel = scroll;
function scroll(event) {
event.preventDefault();
var mousex = event.clientX - canvas.offsetLeft;
var mousey = event.clientY - canvas.offsetTop;
var wheel = parseInt(event.wheelDelta, 10) / 120; //n or -n
var zoom = 1 + wheel / 2;
[... do some action on canvas ...]
};
Gecko doesn't have a plan to implement this event due to legacy event
type and non-standard.
You can try the following link
From the page: onmousewheel event and Firefox's equivalent
var mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x
if (document.attachEvent) //if IE (and Opera depending on user setting)
document.attachEvent("on"+mousewheelevt, function(e){alert('Mouse wheel movement detected!')})
else if (document.addEventListener) //WC3 browsers
document.addEventListener(mousewheelevt, function(e){alert('Mouse wheel movement detected!')}, false)