Rafcio Kowalsky Rafcio Kowalsky - 3 months ago 16
Javascript Question

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?

Answer

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

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