https://github.com/developit/ford-delegate
Delegate Responsibly®
https://github.com/developit/ford-delegate
Last synced: 3 months ago
JSON representation
Delegate Responsibly®
- Host: GitHub
- URL: https://github.com/developit/ford-delegate
- Owner: developit
- License: mit
- Created: 2014-11-26T22:10:53.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-01T16:14:04.000Z (almost 11 years ago)
- Last Synced: 2025-09-12T00:45:32.986Z (4 months ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ford-delegate
=============
> Delegate Responsibly®
This is just a plugin for ford.js that adds event delegation support to `on()` and `off()`.
---
Usage Example
-------------
```js
// example handler:
function handler(e) {
// e.target is the element that matched your selector
alert( e.target.href );
return false;
}
// add a delegate handler:
$('.parent').on('click', 'a', handler);
// remove a delegate handler:
$('.parent').off('click', 'a', handler);
```