JSFiddle - React, Tailwind, and code Playground

by teneff

HTML

<div id="window">window</div>

CSS

body {
    height: 1400px;
}
div {
    border: 2px solid #ccc;
    width: 300px;
    height: 200px;
    position: absolute;
    top:50px;
    left: 50px;
}

JavaScript

$('#window').click(function(){
    $(this).animate({
        height: 0,
        width: '20px',
        top: $(window).height(),
        left: 0
    }, 200, function(){
        $(this).hide();
    });
});