Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

$.delegate


This is a jquery plugin which handles event delegation. There are a bunch of delegation plugins out there, and this is just an example of additional functionality, that I wanted to try before delegation gets added to the core.

The "delegate" method takes 3 or 4 arguments:

  • type - The type(s) of event being bound/delegated. Seperate multiple events with spaces.
  • selector - The selector(s) to match against event.targets and execute the provided handler. Seperate multiple selectors with commas (extra spaces are allowed).
  • handler - The function to call against the matching selector(s). The scope (this) will be the matched element.
  • data - (optional) Any data to be shared between handlers via the event.data property. Currently, only the initial binding of a delegate handler will bind the data. This will be easily fixed for the next release.

The "undelegate" method takes 0 to 3:

  • type - (optional) The type(s) of event being unbound. Seperate multiple events with spaces.
  • selector - The selector(s) to be removed. Seperate multiple selectors with commas (extra spaces are allowed).
  • handler - The function to be removed. This must also match the selector that the function was paired with.

Downloads



3.666665
Your rating: None Average: 3.7 (3 votes)