This article mainly introduces a simple example of a JS mouse pulley scrolling Event binding (compatible with mainstream browsers). Need friends can come to the reference, I hope to help you.
Code as follows:/** event handler for mouse wheel event. * Mouse scrolling event */ var wheel = function (event) { var delta = 0; if (!event) * for IE. * event = window.event; if (Event.wheeldelta) {/* ie/opera. */ &NBSP ; delta = event.wheeldelta/120; } else if (event.detail) { &NBS P /** Mozilla case. * , /** in Mozilla, sign of Delta are different than in IE.&N Bsp * Also, Delta is multiple of 3. */ & nbsp Delta =-EVENT.DETAIL/3; /** If Delta is Nonzer O, handle it. * Basically, Delta is now positive if wheel was scroll Ed up, * and negative, if wheel was scrolled down. &NBS P */ if (Delta) &NBS P handle (delta); /** prevent default actions caused by mouse wheel. &N Bsp * that might to ugly, but we handle scrolls somehow &N Bsp * anyway, so don ' t bother here. */ if (Event.preventdefau LT) Event.preventdefault (); Event.returnvalue = false; { /** initialization code. * If your own event management code, change it as required. */ if (Window.addeventlistener) { &NBSP ; /** Dommousescroll is for Mozilla. * Window.addeventlistener (' Dommousescroll ', wheel, false); { /** Ie/opera. * Window.onmousewheel = Document.onmousewheel = wheel; &NBSP; /** this are high-level function. * It must react to Delta Bei Ng more/less than zero. */ var handle = Functio N (Delta) { var random_num = Math.floor (Math.random () * +);   ; if (Delta < 0) { &NBS P Alert ("Mouse pulley scrolling down: + Delta +" Times!) "); 1 $ ("Btn_next_pic"). OnClick (Random_num); return; } else { / /alert ("Mouse pulley scrolling up:" + Delta + "Times!") "); -1 $ ("Btn_last_pic"). OnClick (Random_num);   return; { }