Return to Snippet

Revision: 18499
at May 13, 2011 00:48 by cbek


Updated Code
//@dependency jQuery
timeout = undefined;

$("#id").keyup(function() {
    if(timeout != undefined) {
      clearTimeout(timeout);
    }
    var timeout = setTimeout(function() {
      timeout = undefined;
      //do it
    }, 900);
});

Revision: 18498
at October 1, 2009 04:12 by cbek


Initial Code
timeout = undefined;

$("#id").keyup(function() {
    if(timeout != undefined) {
      clearTimeout(timeout);
    }
    var timeout = setTimeout(function() {
      timeout = undefined;
      //do it
    }, 900);
});

Initial URL


Initial Description


Initial Title
keyup event with delay

Initial Tags
jquery

Initial Language
JavaScript