2 * jQuery Event Delegation Plugin - jquery.eventdelegation.js
3 * Fast flexible event handling
5 * January 2008 - Randy Morey (http://dev.distilldesign.com/)
9 /* setup list of allowed events for event delegation
10 * only events that bubble are appropriate
24 ], function(i, eventName) {
25 allowed[eventName] = true;
29 delegate: function (event, selector, f) {
30 return $(this).each(function () {
32 $(this).bind(event, function (e) {
36 while (!$(el).is('body')) {
37 if ($(el).is(selector)) {
38 result = f.apply($(el)[0], [e]);
49 undelegate: function (event) {
50 return $(this).each(function () {
51 $(this).unbind(event);