运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body onwheel="myFunction(event)"> <h1>WheelEvent deltaX Property</h1> <p>Scroll this page to see the value of the deltaX property.</p> <p><strong>Note:</strong> Most mouse devices do not have the ability to scroll left and right, and will always return 0.</p> <p id="demo"></p> <script> function myFunction(event) { var x = event.deltaX; document.getElementById("demo").innerHTML = x; } </script> </body> </html>