Is it possible to change html, body to overflow:hidden, etc. and do something if you try to scroll when you can't scroll?
Also, if possible, please let me know the source code.
Please m(__)m
I think you can do it if you change the example below a little bit.
When you run this snippet, an alert appears and the text changes.
var message= document.getElementById("message");
document.addEventListener("wheel", function(e){
e.preventDefault();
message.textContent = "Do not scroll";
alert("Scrolling is prohibited");
});
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<pid="message">Scroll </p>
</body>
</html>
© 2024 OneMinuteCode. All rights reserved.