後我有這樣的樣本隱藏的元素:動畫被執行
CODE HTML:
<div id="overlay-page">
<div class="loader-logo">
<div class="loader-img-container">
<img class="top" src="http://www.googu.ro/wallpaper/image/peisaje/peisaj-07.jpg" alt="Loading" />
<img class="top" src="http://assets.sport.ro/assets/protv/2014/12/31/image_galleries/40908/cele-mai-frumoase-peisaje-din-lume-locurile-pe-care-trebuie-sa-le-vizitezi.jpg" alt="Loading" />
</div>
</div>
</div>
CODE CSS:
@keyframes cf3FadeInOutTopLoader {
0% {
opacity:1;
visibility: visible;
}
45% {
opacity:1;
visibility: visible;
}
55% {
opacity:0;
visibility: hidden;
}
100% {
opacity:0;
visibility: hidden;
}
}
@keyframes cf3FadeInOutBottomLoader {
0% {
opacity:0;
visibility: hidden;
}
45% {
opacity:0;
visibility: hidden;
}
55% {
opacity:1;
visibility: visible;
}
100% {
opacity:1;
visibility: visible;
}
}
/* here your name of id was wrong */
#overlay-page img.top {
animation-name: cf3FadeInOutTopLoader;
animation-timing-function: ease-in-out;
animation-iteration-count: 1;
animation-duration: 2s;
animation-direction: alternate;
}
#overlay-page img.bottom {
animation-name: cf3FadeInOutBottomLoader;
animation-timing-function: ease-in-out;
animation-iteration-count: 1;
animation-duration: 2s;
animation-direction: alternate;
}
#overlay-page img{
position: absolute;
left: 0px;
right: 0px;
margin: 0 auto;
width:200px;
}
的親這個動畫的缺點是我想運行一次,並在動畫結束後隱藏".top"
元素。
我該怎麼做? 基本上有兩件事很重要:
1.運行一次動畫。
2.該項目被執行後隱藏
Thaniks提前!