Skip to content

Instantly share code, notes, and snippets.

@zetter
Created March 26, 2011 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zetter/888613 to your computer and use it in GitHub Desktop.
Save zetter/888613 to your computer and use it in GitHub Desktop.
jquery extension to register click events that won't bubble. Call instead of click(func).
jQuery.fn.preventDefaultClick = function(f) {
this.click(function(e){
f.call(this, e);
e.preventDefault();
});
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment