Rebecca Murphey provides a look at using custom events in jQuery. While she doesn't really get to the why until the end of the article, the benefits are certainly something worth having in your code:
Well-organized code that consolidates the behavior widgets in a few bind() statements, rather than scattering those behaviors across the elements that initiate them
- Added flexibility as it’s any element can initiate a behavior, or a behavior can be triggered across multiple widgets at once
- Use of a control element which
captures a click event and translates it into an event to be triggered on the widget.
- Better organization of your code, abstraction and increased ability to reuse code
I'm no JavaScript wizard and I am looking forward to implementing some of this logic in the near future to consolidate some of the jQuery we use in a few client sites.