// Override the mouse wheel event mxEvent. addMouseWheelListener = function (funct) {}// adds the window for the first loading event. onload = function () {var element = document. getElementById ('graph'); addScrollListener (element, wheelHandle);} function addScrollListener (element, wheelHandle) {if (typeof element! = 'Object') return; if (typeof wheelHandle! = 'Function') return; // monitor the browser if (typeof arguments. callee. browser = 'undefined') {var user = navigator. userAgent; var B ={}; B. opera = user. indexOf ("Opera")>-1 & typeof window. opera = "object"; B. khtml = (user. indexOf ("KHTML")>-1 | user. indexOf ("AppleWebKit")>-1 | user. indexOf ("Konqueror")>-1 )&&! B. opera; B. ie = user. indexOf ("MSIE")>-1 &&! B. opera; B. gecko = user. indexOf ("Gecko")>-1 &&! B. khtml; arguments. callee. browser = B;} if (element = window) element = document; if (arguments. callee. browser. ie) element. attachEvent ('onmousewheel ', wheelHandle); else element. addEventListener (arguments. callee. browser. gecko? 'Dommousescroll': 'mousewheel', wheelHandle, false);} function wheelHandle (e) {var upcheck; if (e. wheelDelta) {upcheck = e. wheelDelta> 0? 1: 0;} else {upcheck = e. detail <0? 1: 0;} if (upcheck) {myGraph. zoomIn ();} else {myGraph. zoomOut ();} if (window. event) {e. returnValue = false; window. event. cancelBubble = true;} else {e. preventDefault (); e. stopPropagation ();}}PS: myGraph is a global variable, an mxGraph instance.