<!--jQuery and idleTimer -- >
<!-- jQuery and idleTimer -->
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://raw.github.com/thorst/jquery-idletimer/master/dist/idle-timer.min.js"></script>
<h3>This has a 3 second timeout</h3>
<span id="state">active</span>
(function ($) {
(function ($) {
$( document ).on( "idle.idleTimer", function(event, elem, obj){
$("#state").html("idle");
});
$( document ).on( "active.idleTimer", function(event, elem, obj, triggerevent){
$("#state").html("active");
});
$.idleTimer(3000);
})(jQuery);