Last active
September 3, 2021 19:05
-
-
Save LaloHao/f813175d5e67fde6f69a4148f4383228 to your computer and use it in GitHub Desktop.
Disable smooth trolling (scrolling) on websites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: http://stackoverflow.com/a/35611393/992504 | |
document.addEventListener("wheel", event => event.stopPropagation(), true); | |
// document.addEventListener("wheel", event => event.stopPropagation(), { capture: true }); | |
/* | |
document.getElementsByTagName("body")[0].addEventListener("wheel",function (event) { | |
// exception for ACE Editor, JS text editor used by sites like GitHub | |
if (event.target.classList.contains('ace_content')) { | |
return; | |
} | |
event.stopPropagation(); | |
}, true); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment