JSFiddle - React, Tailwind, and code Playground

by phloe

HTML

<img src="http://jsfiddle.net/img/logo.png" name="slide" width="100" height="40" >

JavaScript

function slideit (target, images, step, speed) {

    var image = document.images[target];
    
    (function slide () {
        step = (step < images.length - 1 ) ? ++step : 0;
        image.src = images[step];
        setTimeout(slide, speed);
    })();

}
 
slideit(
    "slide",
    [
        "http://jsfiddle.net/img/keys.png",
        "http://jsfiddle.net/img/top-bg.png",
        "http://jsfiddle.net/img/info-close.png"
    ],
    0,       
    900
);