简体   繁体   English

CustomScrollbar太快了

[英]CustomScrollbar too fast

I am working with the customscrollbar plugin to create a cross browser custom scrollbar. 我正在使用customcrollbar插件来创建跨浏览器自定义滚动条。

The issue is, I can't figure out why my scrollbar is too sensitive. 问题是,我不知道为什么滚动条太敏感。 On a touchpad, it goes down by almost 400 px with a slight scroll. 在触摸板上,略微滚动即可下降近400像素。 Same for the mousewheel as well. 鼠标滚轮也是如此。 I tried debugging in and I thought that the issue might be because of the mousewheel plugin, but still no luck. 我尝试调试,但我认为问题可能是由于mousewheel插件引起的,但还是没有运气。

My code is pretty straight forward - 我的代码很简单-

$('body').mCustomScrollbar({ scrollInertia:1500 });

You need to define where to actually scroll, for example: 您需要定义实际滚动的位置,例如:

$(selector).mCustomScrollbar("scrollTo", "bottom",
        { scrollInertia:1500 });

The problem is with mousewheel events - touchpad generates several times more mousewheel events than usual mouse. 问题在于鼠标滚轮事件-触摸板生成的鼠标mousewheel事件是普通鼠标的几倍。 New version of plugin (3.0.2) incorrectly handles mousewheel events generated by touchpad. 新版本的插件(3.0.2)错误地处理了触摸板生成的鼠标滚轮事件。 Try previous version (2.8.3) - it handles touchpad mousewheel correctly (as I can see from my examples) or contact author and create the bug in issue tracker. 尝试使用以前的版本(2.8.3)-它可以正确处理触摸板鼠标滚轮(如我从示例中看到的),或者与作者联系并在问题跟踪器中创建错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM