iScroll 5 trackpad speed too fast

2.3k views Asked by At

I'm doing a simple image gallery with iScroll 5. Basically I have only 5 images that I can scroll.

If I use clicks and touch (on iPad) works great.

My problem is with trackpads.

So if I try to scroll with trackpad, the scroll jumps from the first image to the last one.

Is there any way I can change the speed of the trackpad?

I'll like not do disable.

Thanks

2

There are 2 answers

4
Jacob Mouka On

I think trackpad uses the mouse wheel event, so you can try setting that speed. Try something lower than the default 20.

var scroll = new IScroll('#wrapper', {
    mouseWheelSpeed: 20 // the default speed
});

Resource: http://iscrolljs.com/#configuring

0
Nao Ito On

did you enable "snap" option?

In that case, the scroll may fire snap action and jump to the bottom (depending on your page or snap settings). You can adjust the scroll speed by adding snapSpeed option. Hope it would work.

Ref: Related thread on Github.