live supports custom events in jQuery 1.4. You can try something like this:
$(function () { $(".reply").live("customToggle", function () { $(this).toggle( function () { x1(); }, function () { x2(); } ); }); $(".reply").live('click', function () { $(this).trigger('customToggle'); }); });
It looks like it works fine without a special event:
$(".reply").live('click', function () { $(this).toggle( function () { x1(); }, function () { x2(); } ); $(this).trigger('click'); });
fehays
source share