Get mousewheel event delta

If you need to get the scroll of the mouse wheel ( mouse event delta ) you can use this script:

$(window).on("mousewheel DOMMouseScroll", function(event){

	var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3;
	console.log(delta);

	event.preventDefault();

});

You can also check the jQuery Mousewheel Plugin by Brandon Aaron

Leave a Reply