Created
November 26, 2017 15:01
-
-
Save import-benjamin/31dec174a4a25e2bd14456f919e6ed69 to your computer and use it in GitHub Desktop.
redirect to the homepage if nobody use the mouse for 10 seconds
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
$(document).ready(function() { | |
let clique = true | |
let secondes = 10 | |
$('body').on('click', function() { | |
clique = true; | |
}) | |
setInterval(function () { | |
if (clique == true) { | |
clique = false | |
} else { | |
window.location = "/" | |
} | |
},secondes*1000) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment