Jquery中的.animate.queue()

Jquery中的.animate.queue(),jquery,jquery-animate,Jquery,Jquery Animate,我有一个函数,在提交表单时从表单中删除答案 删除分区A的命令: target.children("div.A").remove(); 提交时,适用于每个问题。div被移除 然后,如果我将其替换为此函数以设置移除命令的动画: parent.animate({height: "0"},2000).queue( function() { target.children("div.A").remove(); } 所以它只工作一次

我有一个函数,在提交表单时从表单中删除答案

删除分区A的命令:

target.children("div.A").remove();
提交时,适用于每个问题。div被移除

然后,如果我将其替换为此函数以设置移除命令的动画:

parent.animate({height: "0"},2000).queue(
          function() { 
              target.children("div.A").remove(); 
          }
所以它只工作一次。它为第一个问题设置“移除”命令的动画,但不为其他问题设置动画

使用jquery-1.6.2.min.js

如何解决这个问题,使每个答案都充满活力

编辑:父对象,这是同一个Jquery对象。parent.animate()失败


这很管用

你能用一个小片段举个例子吗?也许使用jsfiddle.net可以帮助我们更快、更简单地帮助您。好的,我可以,但您将错过图像(=答案)和Jquery-Jquery-1.6.2.min的链接。jsLink to jsfiddle:注意:您看到图像中的数字,因此无法正常工作。到目前为止,我发现应用于下一个div的代码可以在任何时候工作:parent.next().animate({height:“auto”},2050)。queue(function(){$(this.next().css(“display”,“block”);console.log(“next WORKS”);});
var submit_ = function (that, parent, target){
    var typ = $(that).attr("name");    
    var id = $(that).attr("id");
    var answerDiv=$(that).parent().parent().children("div.A");
    answerDiv.animate({height: "0"},2000,"swing",
              function() { answerDiv.remove(); } );
}