JSFiddle - React, Tailwind, and code Playground
HTML
<div class="fotky">
<img src="http://lorempixel.com/400/200/people/">
<img src="http://lorempixel.com/400/200/abstract/">
<img src="http://lorempixel.com/400/200/fashion/">
<img src="http://lorempixel.com/400/200/cats/">
<img src="http://lorempixel.com/400/200/technics/">
<img src="http://lorempixel.com/400/200/animals/">
</div>
CSS
img {
display: block;
margin: 5px auto;
}
JavaScript
var photos = $(".fotky img").length;
var photo_timer = setInterval(function() {
$(".fotky").children(':last').slideUp(1000, function() {
$($(this)).hide().prependTo(".fotky").slideDown("slow");
photos--;
console.log("Photo no.: " + photos);
if (photos <= 0) clearInterval(photo_timer);
});
}, 1500);