JSFiddle - React, Tailwind, and code Playground
HTML
<div id="image">
<img src="first.jpg" width="260" height="160"/>
<div id="imgtext"> Description of above image </div>
<div id="showme"> Show me </div>
</div><br>
<div id="image">
<img src="first.jpg" width="260" height="160"/>
<div id="imgtext"> Description of above image </div>
<div id="showme"> Show me </div>
</div><br>
<div id="image">
<img src="first.jpg" width="260" height="160"/>
<div id="imgtext"> Description of above image </div>
<div id="showme"> Show me </div>
</div><br>
CSS
#image
{
position: relative;
}
#imgtext
{
position: absolute;
bottom: 0;
background: rgba(0,0,0,0.2);
width: 260px;
height: 30px;
}
#showme
{
width: 260px;
height: 160px;
display: none;
position: absolute;
background: rgba(0,0,0,0.2);
top: 0;
color: #FFFFFF;
}
JavaScript
$("#image").hover(function () {
$("#imgtext").slideToggle(250, function () {
$("#showme").slideToggle(250);
});
}, function () {
$("#showme").slideToggle(250, function () {
$("#imgtext").slideToggle(250);
});
});