goaway/zenbox — pull request #2 by BinaryMuse (2012-05-03 00:09:52+00:00)
Title: Trigger events on the target instead of $.event

This change causes the `zenbox-show`, `zenbox-close`, and `zenbox-closed` events to trigger on the Zenbox target rather than using `$.event.trigger`.

Both methods allow a listener on the document, e.g. `$(document).on('zenbox-show', fn)`; however, only this method will allow a listener on the actual element being shown (or hidden), e.g. `$('#my-modal').on('zenbox-show', fn)`. Furthermore, since the first argument to a jQuery event listener is always a `jQuery.Event` instance, you can find the target of the event with `event.target` if you wish.