JSFiddle - React, Tailwind, and code Playground
by thorst
HTML
<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>
JavaScript
(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);