Created
October 8, 2012 20:24
-
-
Save jamiehs/3854745 to your computer and use it in GitHub Desktop.
Click Timer for jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#my_awesome_element').click(function(event){ | |
var element = this; | |
if (this.timer) clearTimeout(element.timer); | |
this.timer = setTimeout(function(){ | |
console.log("Nothing Pressed for 1000ms"); | |
},1000); | |
return true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment