JSFiddle - React, Tailwind, and code Playground

by jakie8

HTML

<div id="livegallery">
  <ul></ul>
</div>

JavaScript

function parseMe(the_data) {
  for (i = 0; i < the_data.length; i++) {
    var img = the_data[i];
    displayImage(img, 3000 * i);
  }
  setTimeout(function(){
    alert('Getting new data and starting over');
  }, 3000*i);
}

function displayImage(the_img, time) {
  setTimeout(function () {
    $("#livegallery ul").append("<li><img src=\"" + the_img + "\" width=\"20%\"></li>");
  }, time);
}


var the_data = [
  'http://placehold.it/100x100/ff0000/fff',
  'http://placehold.it/100x100/00ff00/fff',
  'http://placehold.it/100x100/0000ff/fff',
  'http://placehold.it/100x100/fff000/fff'
];
parseMe(the_data);