Sie erreichen dies einfach durch Verwendung von CSS-Animationen und Ändern der Deckkraft der verschiedenen Bilder. Hier ist ein codepen, der zeigt, wie es geht.
HTML
<div class="fade-container">
<img src="http://fillmurray.com/200/300" alt="Fading image" class="fade-img"/>
<img src="https://source.unsplash.com/random" alt="Fading image" class="fade-img"/>
<img src="https://placeimg.com/640/480/any" alt="Fading image" class="fade-img"/>
<img src="http://pipsum.com/435x310.jpg" alt="Fading image" class="fade-img"/>
</div>
CSS
.fade-container {
position: relative;
}
.fade-img {
position: absolute;
top: 0;
left: 0;
width: 300px;
}
@keyframes fade {
0% {
opacity: 0; }
4% {
opacity: 1; }
21% {
opacity: 1; }
25% {
opacity: 0;
-webkit-animation-delay: 9s;
animation-delay: 9s; }
100% {
opacity: 0;
-webkit-animation-delay: 9s;
animation-delay: 9s; }
}
.fade-img:nth-child(1) {
animation: fade 12s ease-in-out infinite;
}
.fade-img:nth-child(2) {
animation: fade 12s ease-in-out infinite;
animation-delay: 3s;
opacity: 0;
}
.fade-img:nth-child(3) {
animation: fade 12s ease-in-out infinite;
animation-delay: 6s;
opacity: 0;
}
.fade-img:nth-child(4) {
animation: fade 12s ease-in-out infinite;
animation-delay: 9s;
opacity: 0;
}
Kontrolle: https://daneden.github.io/animate.css/ – MikeVelazco
Ich verstehe einfach nicht, was genau Sie versuchen zu erreichen. Wie es für mich klingt, Sie suchen vielleicht nach GIFs. – domsson
Danke dafür, aber ich weiß GIF Bilder zu verwenden, jetzt ist es Zeit für CSS, die Animation zu machen, Kannst du mir einen Beispielcode geben? – Atomenergy