JSFiddle - React, Tailwind, and code Playground

by rodrigonery

HTML

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <div></div>
</body>
</html>

CSS

div {
  background: red;
  border-radius: 50%;
  height: 100px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100px;
}

JavaScript

$(function() {
  
  var $animar = (function() {
      var _div = $('div');
    _div.animate({ top: '200px' }, 500, function() {
      _div.animate({ top: '0px' }, 500, function() {
        $animar();
      });
    });
  });
  
  $animar();
});