Skip to content

Instantly share code, notes, and snippets.

@irae
Forked from remy/gist:368657
Created April 18, 2010 07:03
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 irae/370058 to your computer and use it in GitHub Desktop.
Save irae/370058 to your computer and use it in GitHub Desktop.
function addEvent(el, type, fn) {
el.addEventListener(type, fn, false);
return function (type, fn) {
return addEvent(el, type, fn);
};
}
// So I can do this:
addEvent(document.getElementsByTagName('img')[0], 'dragend', logEvent)('dragstart', logEvent);
// for kicks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment