Skip to content

Instantly share code, notes, and snippets.

@joeyespo
Created February 12, 2013 17:25
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 joeyespo/4771521 to your computer and use it in GitHub Desktop.
Save joeyespo/4771521 to your computer and use it in GitHub Desktop.
Please, support "open link in new tab" when handling <a> clicks!
$(element).click(function(e) {
// Allow the link to act normally when middle-clicking
// or clicking with a modifier key
if (e.which !== 1 || e.shiftKey || e.ctrlKey || e.altKey) {
return true;
}
// --YOUR CODE--
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment