Skip to content

Instantly share code, notes, and snippets.

@RudolfHattenkofer
Created September 28, 2013 13:45
Show Gist options
  • Save RudolfHattenkofer/6742225 to your computer and use it in GitHub Desktop.
Save RudolfHattenkofer/6742225 to your computer and use it in GitHub Desktop.
Automatically remove and add an event so it only exists once for an element.
(function ( $ ) {
$.fn.offon = function( name, func ) {
this.off( name ).on( name, func );
return this;
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment