JSFiddle - React, Tailwind, and code Playground

by fiddleyetu

HTML

<img id="img" src="https://media.giphy.com/media/8rljBufM9xKkE/giphy.gif" width="550"/>

JavaScript

$(function() {
    var images = [
        'https://media.giphy.com/media/8rljBufM9xKkE/giphy.gif',
        'https://d13yacurqjgara.cloudfront.net/users/660261/screenshots/1746307/applewatch.gif',
        'http://h.fastcompany.net/multisite_files/fastcompany/imagecache/inline-large/inline/2014/09/3035503-inline-i-1-zooming.gif',
        'http://media.giphy.com/media/ToMjGpoRb3V4jEJdk6k/giphy.gif'
    ];
    setInterval(function() {
        var imsrc = images[ Math.floor(Math.random() * images.length) ];
        $(new Image()).attr('src',imsrc).load(function() {
            console.log( this );
            $('#img').attr('src', this.src);
        });
    }, 10000);
});