rochal / jQuery-slimScroll

small jQuery plugin that transforms any div into a scrollable area with a nice scrollbar. Demo and more:
http://rocha.la/jQuery-slimScroll
2.23k stars 928 forks source link

Firefox+Windows: Slimscroll scrolls whole page #289

Open PinkTiu opened 6 years ago

PinkTiu commented 6 years ago

Hey,

if you hover over the slimscroll content and start to scroll not only the slimscroll content is moving but also the whole page. This feels a bit strange. The expected behavior would be that only the slimscroll content scrolls and the page does not.

This only happens in Firefox running under Windows. In Chrome and Edge this works fine. With Firefox running under macOS or Linux this works fine, too.

You can fix the problem the following: After line 394 in the current source code you have to add target.addEventListener('MozMousePixelScroll', _onWheel, false); This solves the problem for me.

PinkTiu commented 6 years ago

ping @rochal

Sh2dow commented 6 years ago

Thanks! @PinkTiu , your fix helped me too!

Brilliant16 commented 6 years ago

@PinkTiu this code works but another problem occur that mouse wheel unexpectedly scroll. If I scroll it will go on bottom in firefox

Even not following wheelStep: 20 (defauklt value) on firefox

karlcow commented 5 years ago

https://github.com/rochal/jQuery-slimScroll/blob/cf39d364e777ef95574c30c42d3b85cb2bf325d3/jquery.slimscroll.js#L389-L400