Copy Code 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. */
Delta = event.wheeldelta/120;
else if (event.detail) {
/** Mozilla case. */
/** in Mozilla, sign of Delta are different than in IE.
* Also, Delta is multiple of 3.
*/
Delta =-EVENT.DETAIL/3;
}
/** If Delta is nonzero, handle it.
* Basically, Delta is now positive if wheel be scrolled up,
* and negative, if wheel is scrolled down.
*/
if (Delta)
Handle (delta);
/** prevent default actions caused by mouse wheel.
* That might is ugly, but we handle scrolls somehow
* Anyway, so don ' t bother here.
*/
if (Event.preventdefault)
Event.preventdefault ();
Event.returnvalue = false;
}
/** initialization code.
* If You use the Your own event management code, change it as required.
*/
if (Window.addeventlistener) {
/** Dommousescroll is for Mozilla. */
Window.addeventlistener (' Dommousescroll ', wheel, false);
}
/** Ie/opera. */
Window.onmousewheel = Document.onmousewheel = wheel;
/** this is high-level function.
* It must react to Delta being more/less than zero.
*/
var handle = function (Delta) {
var random_num = Math.floor (Math.random () * 100) + 50);
if (Delta < 0) {
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
}
}