JSFiddle - React, Tailwind, and code Playground

by Adam Kinnucane

HTML

<div class="container">
  <div class=wrapper>
    <div class="hello">
      <p>hello hello hello hello hello</p>
    </div>
  </div>
</div>

CSS

.container {
  position: relative;
  width: 50px;
  height: 50px;
  border: 1px solid blue;
}

.wrapper {
  position: absolute;
  width: 50px;
  border: 1px solid red;
  height: 50px;
}

JavaScript

function scroll_loop ($el) {
  $el.css('top', '100%');
  $el.animate({
      top: "-100%"
  }, 8000, scroll_loop);
}

scroll_loop($(".wrapper"));