Is it possible to create a jquery “fade” effect on hover (on an anchor with image inside)?
HTML
<ul id="list">
<li>
<a target="_blank" href="http://google.com">
<img src="http://www.littlegiant.co.nz/wp-content/uploads/2012/01/Meccano-293x170.jpg" alt="" />
</a>
</li>
</ul>
CSS
#list li a img {
position: relative;
z-index: -1;
}
#list li a {
display: block;
width: 293px;
height: 170px;
}
#list li a:hover {
background: red;
width: 200px;
height: 50px;
}
Here is what I have so far: http://jsfiddle.net/ecFBK/4/
When you hover over the red appears which is correct – I just don’t know how to make it fade in using jquery. Please no CSS3 suggestions.
You can fake it by adding an overlay to the link. You’ll need to add
position: relativeto the link CSS, and remove thea:hoverCSS, then you can do something like this for the jQuery:See demo