JSFiddle - React, Tailwind, and code Playground

by karim79

HTML

<p>hello</p>

JavaScript

var i = setInterval(function() {

    
    
    var getRandMillis = function () {
        return Math.random() * (300 - 10 + 1) + 10;           
    };

    var pixelShift = 3;
    
    $("p").animate({
        marginTop: +1 * pixelShift + "px",
        marginTop:  -1 * pixelShift + "px"

    }, getRandMillis()).animate({
        
        
    }, getRandMillis()).animate({
        
        marginLeft: 1 * pixelShift + "px"
        
    },getRandMillis()).animate({
        marginLeft: -1 * pixelShift + "px"
    },getRandMillis());
}, 100);