JSFiddle - React, Tailwind, and code Playground

HTML

<div class='show'>Show</div>
<div class='hide'>Hide</div>

<div class='header'>header</div>
<div class='mydiv' vis='hide'></div>
<div class='footer'>footer</div>

CSS

.mydiv{
    width:200px; height:200px; background:#f00; display:none;
}

.header{
    width:200px; height:400px; background:#00f; text-align:center; color:#fff;
}

.footer{
    width:200px; height:70px; background:#0f0; text-align:center; color:#fff;
}

JavaScript

$(document).ready(function(){
    $(".show").click(function(){
        if($(".mydiv").attr('vis')=='show') return;
        $(".mydiv").slideDown();
        $(".header").animate({height:'-=200'})
        $(".mydiv").attr('vis','show');
    })
        
    $(".hide").click(function(){
        if($(".mydiv").attr('vis')=='hide') return;
        $(".mydiv").slideUp();
        $(".header").animate({height:'+=200'})
        $(".mydiv").attr('vis','hide');
    })
    
})