3つのイメージがありますが、3番目のイメージの最後には画面が空白になります。長い間、最初のイメージが再び現れますが、3番目のイメージの直後に再び表示されます。私が得ることができるどんな助けにも本当に感謝します。ありがとう。ここで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'の中にありますかあなたのコードを投稿してください...... –
ああ、ごめんなさい。ここにあります。 https://jsfiddle.net/5pk3zycq/ – Shikz