idleTime = 0; $(document).ready(function () { startIdle(); var idleInterval = setInterval(timerIncrement, 1000); $(document).bind( "mousemove keypress", function () { idleTime = 0; }); });