Idle Timer

The idle timer is built on jQuery and provides two custom events: idle.idleTimer and active.idleTimer, which fire when the user’s idle state has changed.

This example has an idle timeout of 7 seconds. When you move your mouse over the page or start typing, you’re considered “active”. The status above the textarea changes to indicate your current state.

 

 

 

 

(function($){
  
        $(document).bind(“idle.idleTimer”, function(){
            $(“#status”).html(“User is idle :(“).css(“backgroundColor”, “silver”);
        });
       
        $(document).bind(“active.idleTimer”, function(){
             $(“#status”).html(“User is active :D”).css(“backgroundColor”, “yellow”);
        });
       
        $.idleTimer(7000);
   
   
    })(jQuery);

<div id=”status” style=”padding: 5px;”>&nbsp;</div>

Note:

Running this Idile Timer successfully need to include the jquery.js and idletime.js. You can download the idile timer from this below URL,

http://paulirish.com/demo/js/idle-timer.js

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: