Skip to content

Instantly share code, notes, and snippets.

View cmalexander's full-sized avatar

Chris Alexander cmalexander

View GitHub Profile
@cmalexander
cmalexander / inactivity.js
Last active February 6, 2017 22:33 — 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