JSFiddle - React, Tailwind, and code Playground

by hippietrail

HTML

Click me!
<div class="100"></div>
<div class="400"></div>
<div class="700"></div>

CSS

div {
    background:#de9a44;
    margin:3px;
    width:80px;
    height:40px;
    display:none;
    float:left;
}

JavaScript

$(document.body).click(function() {
    if ($("div:first").is(":hidden")) {
        
        var d = [];
        $("div").each(function() {
            var th = $(this);
            d.push(th.slideDown(parseInt(th.attr("class"))));
        });
        
        var wp = $.when.apply($, d);
        
        wp.then(function() {
            $("div").hide();
        })
    }
});