JSFiddle - React, Tailwind, and code Playground

by Berguiga

HTML

<strong><label id="sandwich" >TEST</label></strong>

JavaScript

/*Test Call Back After Animation*/

function myFunction(param1, param2, callback) {
    
    $('#sandwich').animate({
        opacity: 0//Type of animation
        }, 200//Duration of Animation
         , function() {
        //After the complete of animation
        if (callback && typeof(callback) === "function") {
            callback();
        }
    });
}

myFunction('ham', 'cheese', function() { 
    alert('Finished eating my sandwich.');
});