Ajax Loader
×
HTML
<!-- jQuery and idleTimer -->
1
<!-- jQuery and idleTimer -->
2
    <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
3
    <script src="https://raw.github.com/thorst/jquery-idletimer/master/dist/idle-timer.min.js"></script>
4
 
5
<h3>This has a 3 second timeout</h3>
6
<span id="state">active</span>
 
JavaScript
(function ($) {
1
(function ($) {
2
      
3
    $( document ).on( "idle.idleTimer", function(event, elem, obj){
4
        $("#state").html("idle");
5
    });
6
    
7
    $( document ).on( "active.idleTimer", function(event, elem, obj, triggerevent){
8
        $("#state").html("active");
9
    });
10
    
11
    $.idleTimer(3000);
12
    
13
})(jQuery);
 

Untitled

CSSDeck G+