title: How could I fade out using jQuery a setTimeout function?
body: <p>I'm trying to <code>fadeOut</code> an object after some time determined by a <code>setTimeout</code> function. I tried this:</p>
  
  <pre><code>var timer;
  $(window).on('mousemove', function () {
      $("#my_div_id").fadeIn(1900)
      $('#my_div_id').addClass('show');
      try {
          clearTimeout(timer);
      } catch (e) {}
      timer = setTimeout(function () {    
          $('#my_div_id').fadeOut(1900).removeClass('show');   
      }, 5960); 
  });
  </code></pre>
  
  <p>Essentially when you don't move the mouse the jQuery hide the <code>my_div_id</code>and when you move the mouse it shows the div and correctly does the fade in. </p>
  
  <p>Why the <code>.fadeOut(1900)</code> doesn't work?</p>