Seeking a tutorial on enlarging an image on mouse hover, then shading the enlarged image dark for text overlay.
This example lacks the ability to enlarge the image: http://jsfiddle.net/balupton/FZG3v/
CSS:
.ih { position:relative; }
.ih, .ih-image, .ih-info { display:block;width:330px;height:220px; }
.ih-image, .ih-info { z-index:500;position:absolute;top:0;left:0;right:0;bottom:0; }
.ih-info { z-index:501;background:black;color:white; }
HTML:
<img class="ih-image" src="http://designsnack.com/screenshots/image.php width=330&height=220&cropratio=330:220&image=/screenshots/8264948088.jpg"/>
<div class="ih-info">
Your overlay content
</div>
</div>
JS:
$(function(){
$('.ih').hover(
// Over
function(){
var $ih = $(this);
$ih.find('.ih-info').stop(true,true).animate({opacity:0.8}, 400);
},
// Out
function(){
var $ih = $(this);
$ih.find('.ih-info').stop(true,true).animate({opacity:0}, 400);
}
).find('.ih-info').css('opacity',0);
});
If I am unclear or missing any information, please forgive me as this is my first question.
Appreciate any assistance!
EDIT: Special thanks to ghost! My ultimate goal is to enlarge the image from the center for a 4X2 image configuration.