Posted By

cbek on 10/01/09


Tagged

jquery delay timeout keyup


Versions (?)

keyup event with delay


 / Published in: JavaScript
 

  1. //@dependency jQuery
  2. timeout = undefined;
  3.  
  4. $("#id").keyup(function() {
  5. if(timeout != undefined) {
  6. clearTimeout(timeout);
  7. }
  8. var timeout = setTimeout(function() {
  9. timeout = undefined;
  10. //do it
  11. }, 900);
  12. });

Report this snippet  

You need to login to post a comment.