JSFiddle - React, Tailwind, and code Playground

HTML

<body style="margin: 0 auto;">
    <div class="scroll">
        <div class="scrollContainer">
            <div class="scrollText"></div>
        </div>
    </div>
    <div>
        <div>
            <div id="me"></div>
        </div>
    </div>
    <div>
        <div>
            <div id="try">another scroll</div>
        </div>
    </div>
</body>

JavaScript

$(function () {
    function Scroll() {

    }

    $.extend(Scroll.prototype, {
        defaults: {
            text: 'hello everybody',
            speed: 1500,
            container: $('.scrollText'),
            width: 250,
            parent: $('.scrollContainer'),
            parentContainer: $('.scroll'),
            textWidth: 0,
            totalWidth: 0
        },

        setupHtml: function () {
            this.config.container.html(this.config.text.trim())
                .css('display', 'inline-block');

            return this;
        },

        setupCss: function () {
            this.config.textWidth = this.config.container.width();

            this.config.container.css({
                width: this.config.textWidth + 10,
                    'margin-right': this.config.width,
                    'margin-left': this.config.width
            });

            return this.parentCss();
        },

        parentCss: function () {
            this.config.totalWidth = this.config.container.outerWidth(true);

            this.config.parentContainer.css({
                width: this.config.width,
                overflow: 'hidden',
                margin: '0 auto'
            });

            return this;
        },

        animate: function (container) {
            container.animate({
                'margin-left': '-=' + (this.config.totalWidth - this.config.width)
            }, this.config.speed, this.repeat.bind(this, container));

            return this;
        },

        repeat: function (container) {
            container.css('margin-left', this.config.width);

            this.animate(container);
        },

        init: function (config) {
            this.config = $.extend({}, this.defaults, config);

            return this.setupHtml()
                .setupCss()//always
                .animate(this.config.container);
        }
    });

    $.fn.scrollText = function (config) {
        return this.each(function () {
            new...