JavaScript Idle State

This example will fire a function when the users browser has been idle for a predefined length of time.

Simply keep moving your mouse and the function will not be called, however if you do not move your mouse for seconds then an alert will be displayed.

After the alret has been called the idle function will again reset on mouse move and therefore repeating the process.