An open API service indexing awesome lists of open source software.

https://github.com/gdibble/jquery-cleaneventattachment

jQuery plug-in to disattach and attach event handlers in one shortcut function
https://github.com/gdibble/jquery-cleaneventattachment

Last synced: about 1 year ago
JSON representation

jQuery plug-in to disattach and attach event handlers in one shortcut function

Awesome Lists containing this project

README

          

jquery-cleanEventAttachment
===========================

jQuery plug-in to disattach and attach event handlers in one shortcut function

Helper functions to:
* $.unbind('event.namespace').bind('event.namespace', function () { /*callback*/ })
* $.off('event.namespace').on('event.namespace', '.selector', function () { /*callback*/ })

Simply call:
```
jQuery('.selector')
.cleanBind('click.test', function () {
alert('test');
});
```
or
```
$('.selector')
.cleanOn('click.test', '.otherSelector', function () {
alert('test');
});
```

*Internally uses $.on(), thus requiring >= jQuery 1.7*