Created
July 6, 2017 15:31
-
-
Save jrmedd/08237cb0e27464ca7a9773546bf9a479 to your computer and use it in GitHub Desktop.
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
var t; | |
function idleOut() { | |
window.location = 'index.html'; | |
} | |
function resetTimer() { | |
console.log("Reset"); | |
clearTimeout(t); | |
t = setTimeout(idleOut, 10000) | |
} | |
document.onmousemove = resetTimer; | |
document.onkeypress = resetTimer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment