Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery队列函数只执行一次_Jquery_Css - Fatal编程技术网

jQuery队列函数只执行一次

jQuery队列函数只执行一次,jquery,css,Jquery,Css,在执行animated.css动画后,如何将元素返回到其位置? 我使用了这段代码,但它只执行了一次,下一次并没有删除类 $(".stitch") .hover( function () { $(this).addClass("animated hinge"); } ) .delay( 5000 ) .queue( function () { $(this).removeClass("animated hinge").dequeue(

在执行animated.css动画后,如何将元素返回到其位置? 我使用了这段代码,但它只执行了一次,下一次并没有删除类

$(".stitch")
    .hover( function () {
        $(this).addClass("animated hinge");
    } )
    .delay( 5000 )
    .queue( function () {
        $(this).removeClass("animated hinge").dequeue();
    } );
我试着下一个和下一个排队,但没有工作。
提前感谢您的帮助。

如果您希望在动画完成后删除动画类,您可以使用文档中提供的简单jQuery插件代码

$.fn.extend({
animateCss:函数(animationName){
var animationEnd='webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationEnd';
this.addClass('animated'+animationName).one(animationEnd,function(){
$(this.removeClass('animated'+animationName);
});
}
});
var$me=$(“#me”);
$me.hover(函数(){
$me.animateCss(‘铰链’);
} );
@导入url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css' );


您好
您是否希望在动画完成后删除该类?是的,第二次未删除该类,我还将alert and queue didnt executeAnimate.css在其文档中提供了解决方案,我已在我的答案中发布了该解决方案。谢谢hungerstar:x