JSFiddle - React, Tailwind, and code Playground

by Steven Senkus

HTML

<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<div id="container">
    <div id="target"></div>
</div>

CSS

#container {
    width: 200px;
    height: 200px;
    border: 2px solid #00c;
    background-color: #999;
    color: #fff;
}
#target {
    width: 100px;
    height: 100px;
    background-color: #007;
}

JavaScript

$(document).ready(function () {
    var def = new $.Deferred(), prom;
    $(document).on('click', function () {
        prom = $('#target').effect({
            effect: 'blind',
            duration: 500,
            complete: function () {
                def.resolve(new Date().getTime());
                
            }
        });
        def.notify(new Date().getTime())
        return def.promise;
    });
    
    $.when(def).then(function(msg) {
        console.log('resolved', msg)
    }, function() {}, function(msg) {
        console.log('notified', msg)
    })

    
    
});