1

I am trying to implement Eric Hynds' jquery-idle-timeout dialog which works fine without any issues. But how can I timer / idle timeout to get work even during computer sleep or phone screen-off.

Currently timer getting paused if computer sleeps or phone screen-off.

Do I need to add any specific jquery events apart from mousemove keydown DOMMouseScroll mousewheel mousedown?

Any help would be highly appreciated.

Dipak G.
  • 715
  • 1
  • 4
  • 18

1 Answers1

1

You can show the dialog box when the computer sleeps but you can check for the interval when computer wakes up something like this

var oldTime = Date.now();

var expire = 50000; //expire time in ms

var interval = 5000; //interval time in ms

setInterval(function() 
{
   var newTime = Date.now(),
   if (newTime - oldTime > interval+expire)
   {
      //call the expire function

   }
   oldTime = newTime
}, interval);
Mukesh Agarwal
  • 530
  • 4
  • 15