Skip to content

Instantly share code, notes, and snippets.

@fael
Created September 12, 2011 21:09
Show Gist options
  • Save fael/1212439 to your computer and use it in GitHub Desktop.
Save fael/1212439 to your computer and use it in GitHub Desktop.
Prevent event propagation
kill = function (e) {
if (!e) e = window.event;
(e.stopPropagation) ? e.stopPropagation() : e.cancelBubble = true;
(e.preventDefault) ? e.preventDefault() : e.returnValue = false;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment