JSFiddle - React, Tailwind, and code Playground

by Juan Muñoz

HTML

<span></span>

<button>Click</butto>

CSS

span {
    position: fixed;
    height: 200px;
    background: red;
    top: -200px;
    width: 100%;
    -webkit-transition: all 300ms;
    -moz-transition: all 300ms;
    transition: all 300ms;
}

span.toggled {
    top: 0;
}

JavaScript

$('button').click(function(){
    $('span').toggleClass('toggled');
});

$('span').click(function(){
    $(this).toggleClass('toggled');
});