Tuesday, March 17, 2009

motionbox-eventhandler

A prototype-based javascript event bubbling and custom event library. Allows you to subscribe to elements before they exist in the DOM.

The Motionbox EventHandler allows you to:

  • Subscribe to elements before they are on the DOM
  • Subscribe to entire classes of elements (eg. subscribe to clicks on all elements with the class ".foo")
  • Subscribe to arbitrary Objects (including DOMElements) which allows you to nicely separate your code
  • Use the same interface to trigger events between Objects and/or DOM elements
  • Limit your actual observers to a minimum (Only 1 per type of event) and still subscribe many elements
  • Maintain a consistent interface among both custom, browser, and on Object events
  • Easily defer your functions (fire using setTimeout by simply adding { defer: true } to your subscriptions)
  • Blur and focus events are supported and bubble in all the supported browsers.
http://github.com/tobowers/motionbox-eventhandler/tree/master

No comments: