私は初心者のデベロッパー(多分その下でも)だと言って始めましょう。自分自身についてよく説明しなければ謝ります。CSSを使ってディレイを使ってフェードインでフェードアウトする
私たちの製品に関するいくつかの顧客レビューを画面(FadeIn1、遅延、FadeOut1)、(FadeIn2、遅延、FadeOut2)などにスプラッシュ表示しようとしています。フェードインとフェードアウト私は個別に働くことができません。以下のコードは、それを消すだけです。私が間違っていることを教えてもらえますか?事前のおかげで...
/* keyframes that tell the start state and the end state of our object */
@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; }}
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; }}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; }}
@-webkit-keyframes fadeOut { from { opacity:1; } to { opacity:0; }}
@-moz-keyframes fadeOut { from { opacity:1; } to { opacity:0; }}
@keyframes fadeOut { from { opacity:1; } to { opacity:0; }}
.fade-in {
\t opacity:0; /* make things invisible upon start */
\t -webkit-animation:fadeIn ease-in 1; /* call keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */
\t -moz-animation:fadeIn ease-in 1;
\t animation:fadeIn ease-in 1;
\t
\t -webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/
\t -moz-animation-fill-mode:forwards;
\t animation-fill-mode:forwards;
\t -webkit-animation-duration:1s;
\t -moz-animation-duration:1s;
\t animation-duration:1s;
}
.fade-out {
\t opacity:1; /* make things visible upon start */
\t -webkit-animation:fadeOut ease-out 1; /* call keyframe named fadeOut, use animattion ease-out and repeat it only 1 time */
\t -moz-animation:fadeOut ease-out 1;
\t animation:fadeOut ease-out 1;
\t -webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 0)*/
\t -moz-animation-fill-mode:forwards;
\t animation-fill-mode:forwards;
\t -webkit-animation-duration:1s;
\t -moz-animation-duration:1s;
\t animation-duration:1s;
\t
\t -webkit-animation-delay: 3s;
\t -moz-animation-delay: 3s;
\t animation-delay: 3s;
}
.fade-in.fade-out.one {
-webkit-animation-delay: 0.7s;
-moz-animation-delay: 0.7s;
animation-delay: 0.7s;
}
.fade-in.fade-out.two {
-webkit-animation-delay: 1.2s;
-moz-animation-delay:1.2s;
animation-delay: 1.2s;
}
.fade-in.fade-out.three {
-webkit-animation-delay: 1.6s;
-moz-animation-delay: 1.6s;
animation-delay: 1.6s;
}
/*---basic box ---*/
.box{
width: 200px;
height: 200px;
position: relative;
margin: 10px;
float: left;
border: 1px solid #333;
background: #999;
}
<body>
<div class="box fade-in fade-out one">
look at me fade in and out
</div>
<div class="box fade-in fade-out two">
i can fade too!
</div>
<div class="box fade-in fade-out three">
i can fade three!
</div>
</body>