Skip to content

Instantly share code, notes, and snippets.

@netojoaobatista
Created April 20, 2012 15:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save netojoaobatista/2429495 to your computer and use it in GitHub Desktop.
Save netojoaobatista/2429495 to your computer and use it in GitHub Desktop.
Remove todos os manipuladores de eventos que foram anexados aos elementos
/**
* Removes all previously-attached event handlers from the elements.
*/
$.fn.unbindAll = function() {
var events = $(this).data('events');
return this.each( function() {
var $this = $(this);
for ( var evt in events ) {
$this.unbind(evt);
}
});
};
@suissa
Copy link

suissa commented Apr 20, 2012

Boaaa!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment