Skip to content

Instantly share code, notes, and snippets.

View TriniBora's full-sized avatar
💪
Working/Learning/Dreaming 24/7

Trinidad Boragini TriniBora

💪
Working/Learning/Dreaming 24/7
  • Tandil
  • 06:32 (UTC -03:00)
View GitHub Profile
@TriniBora
TriniBora / inactivity.js
Created September 1, 2021 15:19 — forked from gerard-kanters/inactivity.js
Inactivity timeout javascript
<script type="text/javascript">
function idleTimer() {
var t;
//window.onload = resetTimer;
window.onmousemove = resetTimer; // catches mouse movements
window.onmousedown = resetTimer; // catches mouse movements
window.onclick = resetTimer; // catches mouse clicks
window.onscroll = resetTimer; // catches scrolling
window.onkeypress = resetTimer; //catches keyboard actions