JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<span class="click">
<p>Click Me</p>
</span>
<div class="map">
</div>
<div class="navigation">
</div>
</body>
CSS
body {
width: 500px;
}
span.click {
padding: 5px;
display: block;
height: 20px;
width: 60px;
position: absolute;
bottom: 100px;
background-color: red;
margin: 0 auto;
}
p {
line-height: 5px;
color: #fff;
}
div.map {
height: 20px;
width: 50px;
background-color: blue;
position: relative;
bottom: 0;
opacity: 0;
}
div.navigation {
height: 20px;
width: 50px;
background-color: green;
position: relative;
bottom: -150px;
}
JavaScript
$(document).ready(function() {
$("span.click").click(function() {
var io = this.io = !this.io; // Simple I/O toggler
$(".map").animate({"opacity": io ? 1 : 0}, 200);
$(".navigation").animate({"bottom": io ? -100 : -150}, 200);
$(".click").animate({"bottom": io ? 150 : 100}, 200);
});
});