// extend jQuery
$.each(['show', 'hide'], function(i, ev) {
var el = $.fn[ev];
$.fn[ev] = function() {
this.trigger(ev);
return el.apply(this, arguments);
};
});
// then simply attach listener
$(".my-element").on("show", function() {
console.log('my-element shown');
});