Horizontal mouse scrolling

Link to the following example:

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

It works in Chrome but not Firefox.

In Firefox, you can only scroll with the arrow keys, not the mouse wheels.

Does anyone know why this is happening?

+3


source to share


2 answers


This was posted as a solution in the comments of the site you linked to:



$(function() {
        $("html, body").mousewheel(function(event, delta) {
            this.scrollLeft -= (delta * 30);
            event.preventDefault();
        });
    });

      

+2


source


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

http://jsfiddle.net/ata68xr6/



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

$(function() {
   $("html, body, *").mousewheel(function(event, delta) {
       this.scrollLeft -= (delta * 80);
       this.scrollRight -= (delta * 80);
       event.preventDefault();
   });
});

      

+4


source







All Articles