0

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

我有一个具有 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> 而不仅仅是隐藏它?

4

1 回答 1

0

这应该可以解决问题:

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

编辑:对于 IE,请尝试

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

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

当然,您可以做的另一件事是放置一个大横幅或显示IE should Die的页面。

于 2010-03-13T05:40:49.740 回答