使用触控板时捕获 wheel/mousewheel 事件的边缘替代解决方案
Edge alternative solution to capturing wheel/mousewheel event when using trackpad
Edge 上有一个错误,当您使用精确触控板时,wheel/mousehweel 事件不会触发。
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7134034/
问题显示为已修复但尚未修复(已在联想笔记本电脑和 Surface Pro with Edge 最新版本上测试)
有什么办法可以捕捉到这个事件吗?我尝试使用覆盖元素并捕获滚动事件并且它有效但由于该覆盖你无法单击页面上的任何内容,并且没有给它指针事件:none 禁用滚动事件。
有什么想法吗?
在您指出的未决问题中,Microsoft Edge 团队表示,该问题已通过实施 this blog post 中概述的 PTP 指针事件解决。
In HTML, add the touch-action CSS property to your target element to prevent the browser from executing its default touch behavior in response to gestures:
<canvas height=400 width=400 id="canvas" style="touch-action: none;"></canvas>
In JavaScript, attach a Pointer Event listener to your target element. You can determine the type of pointer that caused the handler to be invoked using the pointerType property of the event object passed into the event listener callback:
document.getElementById('canvas').addEventListener('pointermove', function(event) {
console.log('pointermove!');
});
您可以参考this doc了解更多关于积分活动的详细信息。
Edge 上有一个错误,当您使用精确触控板时,wheel/mousehweel 事件不会触发。
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7134034/
问题显示为已修复但尚未修复(已在联想笔记本电脑和 Surface Pro with Edge 最新版本上测试)
有什么办法可以捕捉到这个事件吗?我尝试使用覆盖元素并捕获滚动事件并且它有效但由于该覆盖你无法单击页面上的任何内容,并且没有给它指针事件:none 禁用滚动事件。
有什么想法吗?
在您指出的未决问题中,Microsoft Edge 团队表示,该问题已通过实施 this blog post 中概述的 PTP 指针事件解决。
In HTML, add the touch-action CSS property to your target element to prevent the browser from executing its default touch behavior in response to gestures:
<canvas height=400 width=400 id="canvas" style="touch-action: none;"></canvas>
In JavaScript, attach a Pointer Event listener to your target element. You can determine the type of pointer that caused the handler to be invoked using the pointerType property of the event object passed into the event listener callback:
document.getElementById('canvas').addEventListener('pointermove', function(event) {
console.log('pointermove!');
});
您可以参考this doc了解更多关于积分活动的详细信息。