Click Timer For jQuery

/ Published in: jQuery
Save to your folder(s)

Copy this code and paste it in your HTML
  1. $('#my_awesome_element').click(function(event){
  2. var element = this;
  3. if (this.timer) clearTimeout(element.timer);
  4. this.timer = setTimeout(function(){
  5. console.log("Nothing Pressed for 1000ms");
  6. },1000);
  7. return true;
  8. });

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.