有关jquery收起和展开的

当点击回复时,展开内容并且把展开改为收起回复,当点击收起回复内容,把收起回复改为原来的回复();我写了以下代码,行不通。

 $(".repeat").toggle(function(){
     $(this).text($txt);

     $(this).parent().siblings(".other-comment").hide();



},function(){
     var $txt=$(this).text();
     $(this).text("收起回复");
    $(this).parent().siblings(".other-comment").show();
    ;

})

我的如果不要 $(this).text($txt);也是可以运行的

http://blog.csdn.net/o_pikaka/article/details/7828121