但是,我有三個圖像,在第三張圖像的末尾屏幕變爲空白。經過很長一段時間後,第一張圖像再次出現,但我希望它在第三張圖像後立即重現。真的很感謝我能得到的任何幫助。謝謝。 https://jsfiddle.net/5pk3zycq/CSS圖像交叉淡化不能正常工作
下面是代碼:
#crossfade > img {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
color: transparent;
opacity: 0;
z-index: 0;
-webkit-backface-visibility: hidden;
-webkit-animation: imageAnimation 30s linear infinite 0s;
-moz-animation: imageAnimation 30s linear infinite 0s;
-o-animation: imageAnimation 30s linear infinite 0s;
-ms-animation: imageAnimation 30s linear infinite 0s;
animation: imageAnimation 30s linear infinite 0s;
}
#crossfade > img:nth-child(2) {
background-image: url(images/background-2.jpg);
-webkit-animation-delay: 6s;
-moz-animation-delay: 6s;
-o-animation-delay: 6s;
-ms-animation-delay: 6s;
animation-delay: 6s;
}
#crossfade > img:nth-child(3) {
background-image: url(images/background-3.png);
-webkit-animation-delay: 12s;
-moz-animation-delay: 12s;
-o-animation-delay: 12s;
-ms-animation-delay: 12s;
animation-delay: 12s;
}
<div id="crossfade">
<img src="images/background-1.jpg" alt="Image 1">
<img src="images/background-2.jpg" alt="Image 2">
<img src="images/background-3.png" alt="Image 3">
</div>
我建議複製這個jsfiddle或codepen,或作爲一個片段在這裏。 – Toby
'imageAnimation'裏面有什麼?請發佈所有代碼...... –
啊,是的,對不起,我對這個和jsfiddle有點新。這裏是。 https://jsfiddle.net/5pk3zycq/ – Shikz