This PR fixes #16 which reported an issue with tinyscrollbar in Firefox 28 on OSX (possibly elsewhere) where the scrolling area would scroll at the same time as the window would scroll, creating a strange, undesirable parallax effect.
To replicate the issue
On FF 28 on OSX, create page which scrolls normally, i.e. the body is taller than the window. Then create a tinyscrollbar div any size. Scrolling the tinyscrollbar div should scroll while the page also scrolls.
The fix
I used the newer wheel event over mousewheel or DOMMouseScroll where available and normalized the event.deltaY value for consistent cross browser scrolling. MDN has some great information for reference [source]. We normalize the event.deltaY value with a fallback to event.wheelDeltaY and event.detail when necessary.
Thanks
Thanks for creating this scrollbar plugin, it's pretty awesome! After looking into and testing others, this was a great choice with the small size and browser support that we were looking for. Hoping to contribute any future fixes we come across!
This PR fixes #16 which reported an issue with tinyscrollbar in Firefox 28 on OSX (possibly elsewhere) where the scrolling area would scroll at the same time as the window would scroll, creating a strange, undesirable parallax effect.
To replicate the issue
On FF 28 on OSX, create page which scrolls normally, i.e. the body is taller than the window. Then create a tinyscrollbar div any size. Scrolling the tinyscrollbar div should scroll while the page also scrolls.
The fix
I used the newer
wheel
event overmousewheel
orDOMMouseScroll
where available and normalized theevent.deltaY
value for consistent cross browser scrolling. MDN has some great information for reference [source]. We normalize theevent.deltaY
value with a fallback toevent.wheelDeltaY
andevent.detail
when necessary.Thanks
Thanks for creating this scrollbar plugin, it's pretty awesome! After looking into and testing others, this was a great choice with the small size and browser support that we were looking for. Hoping to contribute any future fixes we come across!