我有这个代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
window.addEventListener('DOMMouseScroll', mouseWheelEvent);
window.addEventListener('mousewheel', mouseWheelEvent);
function mouseWheelEvent() {
alert(1);
}
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
它适用于Chrome和Firefox.但是,它不能与我的笔记本电脑dell xps 13 9434的触控板在IE和边缘.但它确实与(某些)其他笔记本电脑的触摸板配合使用.该怎么办?jQuery没问题.
"什么行不通?" =>使用2个手指时,滚动时没有警报,就像您在浏览器中滚动一样.
javascript internet-explorer mouseevent multi-touch microsoft-edge