Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mousewheel horizontal scrolling

Referencing to the following example:

http://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/

It does work under Chrome, but does not under Firefox.

In Firefox you can scroll only using arrow keys but not mousewheel.

Somebody know why this happens?

like image 454
Rafff Avatar asked Jul 18 '26 11:07

Rafff


1 Answers

I made a fiddle where you have a working example of a horizontal mouse scroll.

http://jsfiddle.net/ata68xr6/

using jquery.mousewheel.js and jquery with the function:

$(function() {
   $("html, body, *").mousewheel(function(event, delta) {
       this.scrollLeft -= (delta * 80);
       this.scrollRight -= (delta * 80);
       event.preventDefault();
   });
});
like image 127
Adam Swén Avatar answered Jul 20 '26 01:07

Adam Swén