简体   繁体   English

有没有办法使用animate.css循环组合动画? 我正在尝试弹跳/滑行并让它们弹跳出来

[英]Is there a way to loop combined animations using animate.css? I am trying to bounce/slide in words and have them bounce out

Basically I am trying to create a slideshow of text only using the bounceInLeft then bounceInRight using Dan Eden's animate.css : https://daneden.github.io/animate.css/ 基本上,我试图仅使用bounceInLeft创建文本幻灯片,然后使用Dan Eden的animate.css创建bounceInRight: https ://daneden.github.io/animate.css/

Instead of applying both classes to a tag, which doesn't work, I used the webkit animation to start the second animation 2 seconds later. 我没有使用两个类都对一个标签起作用,而这是行不通的,而是使用Webkit动画在2秒后开始第二个动画。 This works but only goes through one time and I'd like to have it loop but with other words as well. 这项工作有效,但只经历了一次,我想让它循环播放,但也要换句话说。 I also tried adding the infinite class but it only repeats the last animation (bounceOutRight). 我还尝试添加无限类,但它仅重复最后一个动画(bounceOutRight)。 Adding a third and fourth animation to the webkite-animation also does not seem to work. 向webkite动画中添加第三和第四动画似乎也不起作用。

I have very limited javascript knowledge and I'm assuming I just need to create an array of the words I want and have them loop through but I'm not sure how I would go about that. 我的JavaScript知识非常有限,我假设我只需要创建所需的单词数组并让它们循环遍历即可,但是我不确定该如何处理。 Any help would be appreciated! 任何帮助,将不胜感激!

.bounceInLeft {
-webkit-animation: bounceInLeft 1s, bounceOutRight 2s;
-webkit-animation-delay: 0s, 1.5s;
}

This should work: 这应该工作:

.bounceInLeft {
-webkit-animation: bounceInLeft 1s infinite, bounceOutRight 2s infinite;
-webkit-animation-delay: 0s, 1.5s;
}

If you only add it on the last one, it will of course only repeat the last one. 如果仅将其添加到最后一个,那么它当然只会重复最后一个。

找到了一个执行此http://morphist.fyianlai.com/的jquery插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM