title: reset the timer while user is typing or clicking the screen
body: <p>I want to reset the timer while user is typing in input or clicking the screen.
  Here's my code, but it doesn't reset the timer.
  Can you tell me where is the problem and how should I solve it ?</p>
  
  <pre><code>$(document).ready(function() {
      $(".data-lock").click(function() {
          $(this).animate({
              bottom: '100%'
          }, function() {
              $(".back-img").addClass("lock-up");
              $(".logbox").addClass("logboxinfead");
              setTimeout(function() {
                  $(".data-lock").animate({
                      bottom: '0'
                  }, function() {
                      $(".back-img").removeClass("lock-up");
                      $(".logbox").removeClass("logboxinfead");
                  });
              }, 30000);
          });
      });
      var idleInterval = setInterval(timerIncrement(), 60000); // 1 minute
  
      //Zero the idle timer on mouse movement.
      $(this).mousemove(function(e) {
          idleTime = 0;
      });
      $(this).keypress(function(e) {
          idleTime = 0;
      });
  });
  
  function timerIncrement() {
      idleTime = idleTime + 1;
      if (idleTime &gt; 19) { // 20 minutes
          window.location.reload();
      }
  });
  </code></pre>