Forum Moderators: not2easy
<article id="SlideShow"><img src="_Graphics/image1.jpg" alt=""/>
<img src="_Graphics/image2.jpg" alt=""/>
<img src="_Graphics/image3.jpg" alt=""/>
<img src="_Graphics/image4.jpg" alt=""/></article>
#SlideShow img {
position: absolute;
max-width: 60em;
}
#SlideShow img:nth-of-type(1) {
animation-name: fader;
animation-delay: 4s;
animation-duration: 2s;
z-index: 20;
}
#SlideShow img:nth-of-type(2) {
z-index: 10;
}
#SlideShow img:nth-of-type(n+3) { display: none; }
@keyframes fader {
from { opacity: 1.0; }
to { opacity: 0.0; }
}
window.addEventListener("DOMContentLoaded", function(e) {
var stage = document.getElementById("SlideShow");
var fadeComplete = function(e) { stage.appendChild(arr[0]); };
var arr = stage.getElementsByTagName("img");
for(var i=0; i < arr.length; i++) {
arr[i].addEventListener("animationend", fadeComplete, false);
}
}, false);
you may see a basic CSS only example here...
[codepen.io ]
...and the accompanying code used here...
[codepen.io ]