目前我正在使用swipper旋轉木馬在我創建的網站中。我想爲每個滑動圖片的標題添加一些動畫。所以即時通訊使用@ -webkit-keyframes。但只有第一個圖像即時得到這個effect.In其他圖片的內容是static.Any知道該如何實現這個它loads.Appreciate任何help.Thanks後的每張幻燈片......需要動態添加類名稱
.carousel-content{
width: 1200px;
height: 100px;
//padding: 20px;
padding-top:200px;
padding-left:80px;
padding-right: 80px;
position: absolute;
text-align: center;
color:white;
font-size:40px;
font-weight: 800;
-webkit-animation-duration: 10s;
animation-duration: 2s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes fadeInDown {
0% {
opacity: 0;
-webkit-transform: translateY(-20px);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@keyframes fadeInDown {
0% {
opacity: 0;
transform: translateY(-20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
.fadeInDown {
-webkit-animation-name: fadeInDown ;
animation-name: fadeInDown ;
}
HTML
<div class="swiper-container" >
<div class="swiper-wrapper" >
<div class="swiper-slide">
<div class="carousel-content fadeInDown ">
Buisness is good
</div>
</div>
<div class="swiper-slide">
<div class="carousel-content fadeInDown ">
Buisness is good
</div></div>
<div class="swiper-slide">
<div class="carousel-content fadeInDown">
Buisness is good
</div></div>
<div class="swiper-slide">
<div class="carousel-content fadeInDown">
Buisness is good
</div></div>
<div class="swiper-slide" >
<div class="carousel-content fadeInDown">
Buisness is good
</div></div>
<div class="swiper-slide">
<div class="carousel-content fadeInDown">
Buisness is good
</div></div>
</div>
<div class="swiper-pagination"></div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
我的jsfiddle是https://jsfiddle.net/2ume828d/
你能提供你的代碼作爲片斷所有的 –
首先刪除多餘的'「'從你的HTML。這是什麼'類=」旋轉木馬的內容」,‘fadeInDown’'? –
OK給我一分鐘..謝謝 –