Posted By

digitalclubb on 10/31/11


Tagged


Versions (?)

jQuery setTimeout function - mouseenter/mouseleave


 / Published in: JavaScript
 

  1. $("someelement").mouseenter(function(){
  2. clearTimeout($(this).data('timeoutId'));
  3. $(this).find(".tooltip").fadeIn("slow");
  4. }).mouseleave(function(){
  5. var someelement = this;
  6. var timeoutId = setTimeout(function(){ $(someelement).find(".tooltip").fadeOut("slow");}, 650);
  7. $(someelement).data('timeoutId', timeoutId);
  8. });

Report this snippet  

You need to login to post a comment.