JSFiddle - React, Tailwind, and code Playground
HTML
<div class="gal_item gal_small">
<img src="http://beta.firedogcreative.com/media/images/thumbs/small.jpg" alt="Sample Small"/>
<div class="thumb_overlay">
<h4>Zaxby's</h4>
<p>:30 second spot</p>
</div>
</div>
CSS
.gal_item {
display: inline-block;
height: 213px;
margin: 2px 2px 1px 3px;
position: relative;
overflow: hidden;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
.gal_item img {
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
.gal_large {
width: 371px;
}
.gal_small {
width: 183px;
}
.gal_blank {
width: 183px;
}
.thumb_overlay {
background: #f2691f;
color: white;
width: 153px;
position: absolute;
bottom: 0px;
font-family: Archer;
padding: 12px 15px;
line-height: 1.3;
opacity: .75;
}
.gal_large > .thumb_overlay {
width: 341px;
}
.thumb_overlay h4 {
font-weight: 300;
font-size: 1.5em;
}
.thumb_overlay p {
font-weight: 300;
font-size: 1.1em;
color: black;
}
.gal_item > div {
display: none
}
.nojQuery .gal_item > img:hover + div {
display: block;
}
.nojQuery .gal_item > div:hover {
display: block;
}
.nojQuery .gal_item:hover {
left: -10px;
top: -10px;
}
JavaScript
$( document ).ready(function(){
var hovered_item = $(".gal_item").hover(
//mouseInHandler
function() {
var side_adjust = "-10"
if($(this).hasClass("right")){
side_adjust = "10"
}
$( this ).stop(true,false).delay(100).animate({
top: "-10",
left: side_adjust,
}, 200, function() {
// Actions when animation completes.
});
//Also, the thumb overlay
$(this).children(".thumb_overlay").css("top","213px").css("display","block").css("opacity","0").stop(true,false).delay(300).animate({top: "130",opacity: ".75"},300);
},
//mouseOutHandler
function() {
$( this ).stop(true,false).animate({
top: "0",
left: "0",
}, 200, function() {
// Actions when animation completes.
});
//Also, the thumb overlay
$(this).children(".thumb_overlay").stop(true,false).animate({top: "213"},400);
}
);
});