在动画结束之前执行Tweenmax回调 [英] Tweenmax callback being executed before the animation end

查看:495
本文介绍了在动画结束之前执行Tweenmax回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站上使用greensock gsap制作动画。问题在于动画结束之前正在执行的回调。在下面的示例中,元素已在动画的一半处删除。

I am using the greensock gsap for animations on my web site. Problem are the callbacks who are executing before the end of the animation. In the example bellow the elements are being removed somewhere on the half of the animation.

TweenLite.to($(".flipper"), 2, {rotationY:180,onComplete:function(){
    $(this).remove()
}});

有人遇到过同样的问题吗?

Did anyone experienced the same issue?

推荐答案

正如@hjuster指出的那样,CSS中声明的过渡可能与TweenMax中的onComplete回调冲突。我认为在错误的时间调用onComplete的原因

As @hjuster pointed out, a transition declared in CSS can conflict with onComplete callback in TweenMax. I think that the reason why onComplete is invoked in the wrong time

这篇关于在动画结束之前执行Tweenmax回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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