So let's start with slightly simpler HTML:
<ul id="special">
<li><a href="#"><img src="opensrs-2.png" /></a></li>
<li><a href="#"><img src="opensrs-1.png" /></a></li>
</ul>
Here's my solution:
<style type="text/css">
#special a img { border: none;}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#special a').bind('mouseover', function(){
$(this).parent('li').css({position:'relative'});
var img = $(this).children('img');
$('<div />').text(' ').css({
'height': img.height(),
'width': img.width(),
'background-color': 'orange',
'position': 'absolute',
'top': 0,
'left': 0,
'opacity': 0.5
}).bind('mouseout', function(){
$(this).remove();
}).insertAfter(this);
});
});
</script>
EDIT: With fast fade in, fade out:
$('#special a').bind('mouseover', function(){
$(this).parent('li').css({position:'relative'});
var img = $(this).children('img');
$('<div />').text(' ').css({
'height': img.height(),
'width': img.width(),
'background-color': 'orange',
'position': 'absolute',
'top': 0,
'left': 0,
'opacity': 0.0
}).bind('mouseout', function(){
$(this).fadeOut('fast', function(){
$(this).remove();
});
}).insertAfter(this).animate({
'opacity': 0.5
}, 'fast');
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…