Help with mousewheel binding

hi,

I have this code:

$('.slider').bind('mousewheel', function(e){
    if(e.originalEvent.wheelDelta / 120 > 0) {
        prevSlide();
    }
    else{
        nextSlide();
    }
});

If i scroll just enough the function are triggered once, but if I scroll to much it is triggered several times, which I don’t want. Is it possible to make it so that the functions are only triggered once, when I start scrolling up or down on the mousewheel not depending on how much I am scrolling?

Hi,

I’m not a JS expert, but I researched the wheelDelta property.
I found an informative page about it here. It seems to be addressing your issue and that is normalizing how much the mouse has been scrolled and on different browsers.
Maybe someone else can elaborate on how this should be integrated into your code as I don’t know how to write it for you, but I believe this may give you a good resource to view. You’ll probably have to just take the code from there and alter it to suit your needs.

-tyler

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.