<a href="https://www.google.com/" rel="bookmark" title="Google">
<div class="img" style="position: relative; width: 214px; height: 180px;">
<div class="imghovergrid"> </div>
<div class="imghovertextgrid">This is custom field test<br />Date</div>
<img width="214" height="180" src="https://www.IMAGE SOURCE .jpg" class="attachment-thumbnail" alt="" title="title.jpg" /> </div>
</div> <!--align left-->
</a>
</div><!--post-->
</body>
</html>
The CSS:
<style>
.imghovergrid {
z-index: 900;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: #ff6600;
color: #ffffff;
}
.imghovertextgrid {
z-index: 901;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
padding: 11px;
color: #ffffff;
display: block;
}
a img {
border: none;
}
Thats the raw html and css, it uses jquery for the rollover effect. Basically it places an absolute positioned div that overlays the thumbnail image’s div, it gets shown during the hover state (jquery comes in there for that effect)
the query looks something like this:
$('.imghovergrid').fadeTo(0,0);
$('.imghovertextgrid').fadeTo(0,0);
$(".imghovertextgrid").hover(function () {
$(this).fadeTo(0, 1);
$(this).prev(".imghovergrid").fadeTo(0, 0.75);
},
function () {
$(this).fadeTo(0, 0);
$(this).prev(".imghovergrid").fadeTo(0, 0);
}
);
}