JSFiddle - React, Tailwind, and code Playground
by oganez09
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="scroll"></div>
</body>
</html>
CSS
body {
height: 2000px;
}
#scroll {
position: fixed;
top: 30%;
left: 30%;
}
JavaScript
document.addEventListener("mousewheel", function() {
document.getElementById("scroll").textContent = "mouse";
}, false);
document.addEventListener("DOMMouseScroll", function() {
document.getElementById("scroll").textContent = "touch";
}, false);