JSFiddle - React, Tailwind, and code Playground

by arcm111

HTML

<div id="status"></div>

CSS

div{
    width: 400px;
    height: 100px;
    padding: 10px;
    margin: 10px;
    border: 1px solid #000;
}

JavaScript

var msg = "...          ...",
            pos = 0;
        msg += "This is an example of a scrolling message. Isn't it exciting?";

        function ScrollMessage() {
            var status = document.getElementById('status');
            var title = msg.substring(pos, msg.length) + msg.substring(0, pos);
            pos++;
            if (pos > msg.length) pos = 0;
            status.innerHTML = title;
            window.setTimeout("ScrollMessage()", 100);
        };

        ScrollMessage();