如何删除jQuery?

时间:2010-03-13 05:23:07

标签: jquery html tablerow

好的,我真的被困在这里了。

我有一张包含id的tr的表:#tr_ xx 其中xx是一个数字。

项目是一个数字。

if(...部分确保后面的内容仅在所有动画结束时执行一次。

$('#tr_' + item + '>td').fadeOut('slow', function() {                
    if($('#tr_' + item + '>td:animated').length === 0)
    {
        $(this).parent().remove();
        // This function recolors the rows
        // -not really related to this
        Recolor();
        }
    });

问题是tr不会被删除。它只是被隐藏了。

我如何删除< tr>而不只是隐藏它?

1 个答案:

答案 0 :(得分:0)

这应该可以解决问题:

$('#tr_'+item).fadeOut('slow', function(){
    $(this).remove();
}

编辑:对于IE,请尝试

$('#tr_'+item).css('display', 'block').fadeOut('slow', function(){
    $(this).remove();
}

我不知道这是否有效,因为我没有IE来测试它。事情是,<tr>的默认显示是'table-row',这可能是IE中的问题。

当然,你可以做的另一件事是张贴一个大横幅或页面IE should Die