wieringen / tinyscrollbar

A lightweight cross browser javascript scrollbar.
http://baijs.com/tinyscrollbar
Other
398 stars 203 forks source link

Firefox scroll speed (PC v33) #39

Closed builtbybrent closed 9 years ago

builtbybrent commented 9 years ago

Apologies if this is a duplicate, or already covered. I found the scrolling speed really slow in Firefox (PC version, Windows 7, v32 and v33), in both my implementation and the demo pages.

My guess is that Firefox is calculating the wheel event DeltaY values quite differently to other browsers.

I would see Firefox with a DeltaY value of 3 - vs a DeltaY value of 88-100 in Chrome and IE.

My clumsy fix was to check if the browser was new Firefox and account for the “/40” to get the values closer.

if((evntObj.mozMovementY) && (evntObj.type === "wheel")) {
        wheelSpeedDelta = wheelSpeedDelta * 40;
}

This was added to the function wheel(event) - after the vars are declared. I guess it would have been smarter (in my fix) to update the initial var wheelSpeedDelta declaration.

wieringen commented 9 years ago

I think i fixed it. Thanks for the research! :)