We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f662709 commit fc5c3f9Copy full SHA for fc5c3f9
js/user_idle.js
@@ -0,0 +1,20 @@
1
+function isIdle() {
2
+ var time;
3
+ window.onload = notIdle;
4
+ window.onmousemove = notIdle;
5
+ window.onmousedown = notIdle;
6
+ window.ontouchstart = notIdle;
7
+ window.onclick = notIdle;
8
+ window.onkeypress = notIdle;
9
+ window.addEventListener("scroll", notIdle, true);
10
+ function userIdle(){
11
+ //function to run if user idle
12
+ document.write("Idle.........");
13
+ }
14
+ function notIdle(){
15
+ clearTimeout(time);
16
+ time = setTimeout(userIdle, 3000); //time idle
17
18
+}
19
+
20
+isIdle();
0 commit comments