Skip to content

Instantly share code, notes, and snippets.

@appden
Created April 7, 2009 20:09
Show Gist options
  • Save appden/91434 to your computer and use it in GitHub Desktop.
Save appden/91434 to your computer and use it in GitHub Desktop.
Native.implement([Element, Window, Document, Events], {
oneEvent : function(type, fn) {
return this.addEvent(type, function() {
this.removeEvent(type, arguments.callee);
return fn.apply(this, arguments);
});
}
});
/*
Please see for more info:
http://appden.com/javascript/fun-with-custom-events-on-elements-in-mootools/
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment