DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

hal has posted 2 posts at DZone. View Full User Profile

Jquery.halogen.js

03.20.2009
| 1612 views |
  • submit to reddit
        Plugin for halogen 

jQuery.announce = function(event, eventObject){
   var myEventArray = event.split('.');
   eventObject  = eventObject ? eventObject : eventObject = {};
   eventObject.origin = myEventArray[0];
   eventObject.event = event;
   jQuery(document)
      .trigger(event, eventObject)
      .trigger(myEventArray[1], eventObject)  
      .trigger('event', eventObject)
   ;
   return this;
};

jQuery.listen = function(event, eventObject){
	$(document).bind(event, eventObject);
	return this;
};