How to change direction of mouse scrolling on HTML page?
2 answers
Here's a short function that makes your document scroll horizontally instead of vertically using the mouse wheel:
$(function() {
$("html, body").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 30);
event.preventDefault();
});
});
You will need to include the jquery.mousewheel.min.js script in your page.
Working JSFiddle example: https://jsfiddle.net/1zugp6w6/1/
+2
source to share