Created
January 15, 2018 01:14
-
-
Save FluidCoding/ca98739f87746f0810f726c3625532d9 to your computer and use it in GitHub Desktop.
Toggle Scroll with 'v'
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
(function() { | |
let isON = false; | |
let sTick; | |
window.document.addEventListener('keypress', | |
(e) => { | |
if(e.key=='v'){ | |
isON=!isON; | |
sTick = isON ? setInterval(()=>{window.scrollBy(0,1); }, 20) : clearInterval(sTick); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment