Tutorial Fire Event When User is Idle
See the two commented lines below, that is where you can insert code for things to do when the user goes idle, and when the user comes back....
https://iskablogs.blogspot.com/2014/03/tutorial-fire-event-when-user-is-idle.html
See the two commented lines below, that is where you can insert code for things to do when the user goes idle, and when the user comes back. Set the idle period on the third line, 1000 = 1 second.
idleTimer = null;
idleState = false;
idleWait = 2000;
(function ($) {
$(document).ready(function () {
$('*').bind('mousemove keydown scroll', function () {
idleTimer = null;
idleState = false;
idleWait = 2000;
(function ($) {
$(document).ready(function () {
$('*').bind('mousemove keydown scroll', function () {