Personal I have the following structure:
<h2>
<a class="imgHover" title="titulo" href="#">
<span id="box" class="imgHover">
<img src="imagens/estrutura.jpg" width="400" height="260"
alt="titulo" />
<span class="titulo">Titulo da imagem</span>
</span>
</a>
</h2>
I use the following Jquery in the Hover to change the opacity.
$(document).ready(function ($) {
var navDuration = 150;
$('.imgHover').hover(function () {
//$(this).children("span").stop().animate({ opacity: 1 }, navDuration);
$(this).children("img").stop().animate({ opacity: 0.6 }, navDuration);
}, function () {
//$(this).children("span").stop().animate({ opacity: 0.5 }, navDuration*2);
$(this).children("img").stop().animate({ opacity: 1 }, navDuration * 2);
});
});
This works fine, so I also need to change the opacity of SPAN. When I uncomment the lines that have the SPAN in the script the same does not work more perfectly. What is wrong? Thanks