Mootools IdleTimer
by Espen 'Rexxars' Hovlandsdal
IdleTimer?
This plugin aims to determine when the user is idle (not interacting with the page) so that you can respond appropriately. It is inspired by Nick Zakas' YUI version and Paul Irish's jQuery version.
When is this useful?
- If you want to log the user out of a system after a given amount of idle time.
- If you want to hide or dim page elements when the user is watching a video.
- If you want insanely detailed stats and report how much idle/active time a user has while on your site.
Demo
The "idle time" on the boxes below is concidered 5 seconds and is affected by
mouse movement, keyboard input, mousewheel and mouse button press.
The box to the left conciders the user to be idle after 5 seconds, while the middle box is only triggered after 30 seconds of inactivity has passed. The right box is only triggered by mouse events over that exact box, and conciders the user idle after 10 seconds of inactivity.
After 30 seconds of inactivity, a bar will appear on the top of the page, showing a common usage scenario for this class.
0 ms
0 ms
0 ms
Documentation
See http://github.com/rexxars/IdleTimer/blob/master/Docs/IdleTimer.md
Download
IdleTimer is available for download through the MooTools Forge and Github.