wieringen / tinyscrollbar

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

Bug in Firefox on Mac OS X #52

Closed dmongeau closed 8 years ago

dmongeau commented 9 years ago

There is a bug with the line 210 at least in Firefox using a trackpad from a Macbook pro:

wheelSpeedDelta = -(evntObj.deltaY || evntObj.detail || (-1 / 3 * evntObj.wheelDelta)) / 40

When evntObj.deltaY is equals to 0, it goes to evntObj.detail which is also equals to 0, which goes to (-1 / 3 * evntObj.wheelDelta) returning a NaN.

Also only the deltaY is used even if the axis is set to x.

Here is a pull request that correct this issue: https://github.com/wieringen/tinyscrollbar/pull/51

dmongeau commented 9 years ago

Any updates on this?

zrain commented 9 years ago

if( isNaN(wheelDelta) ){ wheelDelta = -(evntObj.deltaY / 40); }

charlenelu commented 9 years ago

Thanks for @zrain, i`ve fixed using the code.