私は別のCSSアニメーションを次々と再生しようとしていますが、どのようにするかわかりません。さまざまなCSSアニメーションを次々に再生するにはどうすればいいですか?
基本的には、1つのアニメーションを再生して15秒間画面に表示し、次の1つを再生し、15秒間表示し、次の1つを再生します、それは上から再び始めるべきです。
ここでは、最初に再生する必要があるサンプルを15秒間表示し、次のサンプルに移動して同じことを行います。
<style> #animated-example {
width: 300px;
height: 200px;
border: solid 1px #1A7404;
position: absolute;
background-color: #62A80A;
}
.animated {
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes bounceInLeft {
0% {
opacity: 0;
-webkit-transform: translateX(-2000px);
}
60% {
opacity: 1;
-webkit-transform: translateX(30px);
}
80% {
-webkit-transform: translateX(-10px);
}
100% {
-webkit-transform: translateX(0);
}
}
@keyframes bounceInLeft {
0% {
opacity: 0;
transform: translateX(-2000px);
}
60% {
opacity: 1;
transform: translateX(30px);
}
80% {
transform: translateX(-10px);
}
100% {
transform: translateX(0);
}
}
.bounceInLeft {
-webkit-animation-name: bounceInLeft;
animation-name: bounceInLeft;
}
</style>
<img id="animated-example" class="animated bounceInLeft" src="http://webmarketingtoday.com/wp-content/uploads/Screen-Shot-2012-05-24-at-7.31.54-AM-288x216.png">
そして、別のものを実行して、15秒のためにそれを表示し、上に移動します。 http://digitalfio.github.io/Stagger.css/
あなたが欲しい15秒の遅延を取得するタイミングに少し作業する必要があります。私はノアアディことで、この概念を適応させることによって同様のものを達成するために管理している
<style> #animated-example {
width: 300px;
height: 200px;
border: solid 1px #1A7404;
position: absolute;
background-color: #62A80A;
}
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes bounceInDown {
0% {
opacity: 0;
-webkit-transform: translateY(-2000px);
}
60% {
opacity: 1;
-webkit-transform: translateY(30px);
}
80% {
-webkit-transform: translateY(-10px);
}
100% {
-webkit-transform: translateY(0);
}
}
@keyframes bounceInDown {
0% {
opacity: 0;
transform: translateY(-2000px);
}
60% {
opacity: 1;
transform: translateY(30px);
}
80% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
}
}
.bounceInDown {
-webkit-animation-name: bounceInDown;
animation-name: bounceInDown;
}
</style>
<img id="animated-example" class="animated bounceInDown" src="https://www.facebookbrand.com/img/fb-art.jpg">
あなたがアニメーション 'と他の後に開始するために、第2の1を設定する必要があります - 遅れているが、率直に言って、あなたはこの子供のためにJavascriptの方が良い。 –
ありがとうございます。私は第2のものを遅らせましたが、それは最初のものと同じ時間に引き金を引いて、ちょうど横に並んで表示されます。 Javascriptでこれをどうやってやりますか? – Flow
1つのアニメーション(おそらくクラス内)を持っていて、次に、クラス間でタイムアウトを指定してクラスを連続的に適用する要素を反復処理します。 –