Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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