Posted By

Jamie on 11/05/09


Tagged

event prototype delay events timer keypress


Versions (?)

Keypress timer for Prototype


 / Published in: JavaScript
 

  1. $('my_text_field').observe('keyup',function(event){
  2. var element = this;
  3. if (this.timer) clearTimeout(element.timer);
  4. this.timer = setTimeout(function(){
  5. alert("Nothing Pressed for 1000ms")
  6. },1000);
  7. return true;
  8. });

Report this snippet  

You need to login to post a comment.