JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main"> <a href="#" onclick="display()">Display Div</a>
</div>
<div id="boxwrapper"></div>
CSS
body {
background: black;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: 100%;
color: white;
font-family:'Segoe UI';
font-size: 24px;
}
.box {
width: 100%;
margin: auto;
top: 0px;
left: 20%;
right: 0px;
bottom: 0px;
background-color: white;
opacity: 0.4;
position: fixed;
overflow-y: scroll;
overflow-x: scroll;
}
#boxwrapper {
background: white;
height: 200px;
width: 200px;
margin: 50px;
}
JavaScript
function display() {
if ($('#boxwrapper ').css('display') === 'none') {
$('#boxwrapper').show();
} else {
$('#boxwrapper').hide();
}
}