Created
September 16, 2019 17:19
-
-
Save kanonji/caa465799cdb2824dfa72041650eb486 to your computer and use it in GitHub Desktop.
TwitterのTLでしばらくスクロールし続けてほしい時のコード
This file contains hidden or 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
let intervalInSecond = 1 | |
let stopScrolling = (function(seconds) { | |
let intervalId = setInterval(function() { | |
window.scrollBy(0, window.pageYOffset) | |
}, seconds * 1000) | |
return function() { | |
clearInterval(intervalId) | |
}; | |
})(intervalInSecond); | |
// To stop scrolling | |
stopScrolling() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment