This is from mtkopone
at: http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom/10172676#10172676
Added to my gists for quick reference.
(function($) {
jQuery.event.special.destroyed = {
remove: function(o) {
if (o.handler)
o.handler();
}
};
})(jQuery);
Usage:
$el.bind("destroyed", function() {})