Skip to content

Instantly share code, notes, and snippets.

@fivetwentysix
Created January 12, 2011 04:58
Show Gist options
  • Select an option

  • Save fivetwentysix/775711 to your computer and use it in GitHub Desktop.

Select an option

Save fivetwentysix/775711 to your computer and use it in GitHub Desktop.
Element.implement('setEvent', function(eventType, func) {
var self = this;
self
.removeEvents(eventType)
.addEvent('click', function(e) {
e.stop();
func.bind(self)()
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment