Animate.css - 等待动画完成后再继续 [英] Animate.css - Wait for animation to finish before continuing

查看:847
本文介绍了Animate.css - 等待动画完成后再继续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Animate.css在我正在创建的应用程序的动画。我正在寻找一种方法等待动画完成,然后继续。这里是我想的工作,但不是。任何帮助已经完成!

I'm currently using Animate.css for animation around the app I'm creating. I'm looking for a way to wait for the animation to finish before continuing. Here's what I thought would of worked, but doesn't. Any help is appcieated!

$("#myDiv").addClass("animated flipOutY", function() {
  return $("#myDiv").empty();
});


推荐答案

没有跨浏览器的方式,设置超时。

There's no cross-browser way to do this except for setting a timeout.

setTimeout($('#myDiv').empty, 500);

这里有一些基于浏览器的前缀方法,但我想我记得它们不可靠。请参阅此SO问题: CSS转换回调

There are some browser-prefixed methods for this, but I think I remember them being unreliable. See this SO question: Callback on CSS transition

这篇关于Animate.css - 等待动画完成后再继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆