JSFiddle - React, Tailwind, and code Playground
by Eric
HTML
<div class="toggleBox">
<a href="#" class="toggler">Link</a>
<div class="content">
Text
</div>
</div>
CSS
.toggleBox
{
position:absolute;
bottom: 0px;
left: 0px;
width: 300px;
}
.toggleBox .toggler
{
height: 24px;
color: red;
display: block;
}
.toggleBox .content
{
height: 180px;
display: none;
background-color: #2c2c2c;
color: #ffffff;
}
JavaScript
$('.toggleBox').each(function() {
var box = $(this);
box.find('a.toggler').click(function() {
box.find(".content").slideToggle();
return false;
});
});