Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jscrollpane horizontal mousewheel

I have been unsuccessful getting the mouse wheel to scroll a horizontal jscrollpane. Does anyone have experience with this and can offer some pointers.

In the comments of the js file I see the following update just a couple of months ago // 2.0.0beta3 - (2010-08-27) Horizontal mousewheel, mwheelIntent, keyboard support, bug fixes

I've looked on the github issues page and Kelvin's FAQ and known issues pages as well as the google group and nothing makes me think this shouldn't be possible.

Any assistance is appreciated.

like image 828
Rob Allen Avatar asked Dec 21 '22 21:12

Rob Allen


1 Answers

You could use something like this:

$('.scroller').each(function(){
    var scrollPane = $(this).jScrollPane();
    var api = scrollPane.data('jsp'); 
    scrollPane.bind( 
        'mousewheel',
        function (event, delta, deltaX, deltaY) 
        { 
            api.scrollByX(delta*-50);
            return false;
        } 
    ); 
});

Change -50 to another value to change the speed and direction of the scrolling.

like image 158
Philip Seyfi Avatar answered Jan 08 '23 12:01

Philip Seyfi