Disable Predictive Scrolling - Mousewheel (OnScroll) Event fires too often (Touchpad)

前端 未结 2 748
醉酒成梦
醉酒成梦 2021-02-09 02:38

I am executing Javascript onScroll. My code works great with any normal computer mouse, but when I use my notebook\'s touchpad, I encounter the following situation:

2条回答
  •  一整个雨季
    2021-02-09 02:48

    To achieve this, you'd have to distinguish between mouse scroll events and touchpad events, which is not (yet) possible using JavaScript. It was already asked in question How to capture touch pad input.

    Pointer Events are currently in state of Editor's Draft and not yet supported by any browser. See also touch events docs on MDN.

提交回复
热议问题