I want to make a hover effect using jquery. Opacity and a simple zoom icon.
This is what i´ve got:
$(document).ready(function() {
$('.mpost-t1-img').animate ({
opacity: 1
});
$('.mpost-t1-img').hover(function() {
$(this).stop().animate({opacity:.5});
}, function(){
$(this).stop().animate({opacity:1});
});
This works for the opacity. But how can I add the image to the hover state? Thank you!
(Update)
I’ve read in other comments that you want overlay. For basic overlay you don’t need any JS, but pure CSS. Below is example.
CSS:
HTML:
Here is working sample: http://jsfiddle.net/7Mqer/2/
Then if you want animation, you can add some JS. Below is example.
Changes in CSS:
JS:
Working sample: http://jsfiddle.net/7Mqer/1/