I have an image, that on hover, I want to have an opacity of .7, and then the hidden text to show. I have it working, but the text also fades, as it is a child of the faded image.
Is there a way around fixing this so the text doesnt fade?
Things to take into consideration are that the whole thing will be in bootstrap and the images are dynamically loaded from a db as well as the text.
Heres what I have working so far(thanks to researchinmg other threads on this site).
html
<div class="portfolioImage" style="background-image: url('http://placekitten.com/200/150');">
<div class="footerBar">A Sample Image</div>
</div>
css
.portfolioImage {
width: 200px;
height: 150px;
position: relative;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
ms-transition: all 0.3s ease;
transition: all 0.3s ease;
opacity: 1.0;
z-index: 3;
}
.footerBar {
position: relative;
top: 50%;
transform: translateY(-50%);
display: none;
text-align:center;
color:#000;
}
jQuery
$('.portfolioImage').hover(function(){
$(this).css({"opacity":"0.7"});
$('.footerBar').css('display','block');
},
function () {
$(this).css({"opacity":"1.0"});
$('.footerBar').css('display','none');
}
);
heres a fiddle showing the example jsfiddle
any help greatly appreciated