如何在动画完成后重新运行动画(jQuery)?
我想做的是在页面上连续地制作图像动画,同时可以拖动。目前,它可以移动、可拖动,并在初始动画完成后返回到初始位置。
但是,我不知道如何让它再次运行,以便它成为动画的连续循环。我想将函数 animateCloud() 放在 animateCloud() 中,但不确定将其附加到哪里。下面是 jsFiddle 演示:
http://jsfiddle.net/iamacatperson/SfFgt/2/
如果有更好的方法来做到这一点,我也将不胜感激。我刚刚开始学习 jQuery,我只知道一些语法。
What I am trying to do is to animate an image across the page, continuously, while being draggable at the same time. Currently, it moves across, is draggable, and goes back to the initial position after the initial animation is done.
However, I don't know how to get it to run again so that it's a continuous loop of animation. I was thinking to put the function animateCloud() inside animateCloud() but not sure where to attach it. Below is the jsFiddle demo:
http://jsfiddle.net/iamacatperson/SfFgt/2/
I would also appreciate if there's a better method of doing this. I am just starting to learn jQuery and I only know a couple of syntax.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你为什么使用
.stop()
但我想这应该可行 -我希望这就是你想要的。
I don't know why are you using
.stop()
but I guess this should work-I hope this is what you want.