jQuery Tools - Range Input with Mousewheel support

Posted by pspahn on Stack Overflow See other posts from Stack Overflow or by pspahn
Published on 2012-04-05T23:24:40Z Indexed on 2012/04/05 23:30 UTC
Read the original article Hit count: 240

Filed under:

I've got a nice looking horizontal scroller that uses the Range Input feature of jQ Tools. Mouse wheel scrolling support would be awesome, and I'm sure it can work, just not sure how to get it set up. I've got the generic setup:

var scroll = jQuery('#scroll');
jQuery(':range').rangeinput({
    speed: 0,
    progress: true,
    onSlide: function(ev, step) {
        scroll.css({left: -step});
    },
    change: function(e, i) {
        scroll.animate({left: -i}, "fast");
    }
}); 

The doc page ( http://jquerytools.org/documentation/toolbox/mousewheel.html ) for mousewheel gives an example:

$("#myelement").mousewheel(function(event, delta) {

});

But I'm not sure how this hooks in. Other tools in the package simply allow the option:

mousewheel: true

Unfortunately that doesn't work on range input. Any advice appreciated. Thank you.

© Stack Overflow or respective owner

Related posts about jquery-tools