Posted By

johnloy on 10/03/08


Tagged

javascript textmate jquery events


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

alejandrosuch


JQuery function to handle event delegation


 / Published in: Other
 

  1. jQuery.delegate = function(rules) {
  2. return function(e) {
  3. var target = $(e.target);
  4. for (var selector in rules)
  5. if (target.is(selector)) return rules[selector].apply(this, $.makeArray(arguments));
  6. }
  7. }

Report this snippet  

You need to login to post a comment.