When I use $('#nervID').mouseout(function(){/* ... */});
alert()
works and .animate()
works normally with opacity working and being applied to elements with class .page
The problem is that if I change .mouseout()
to .click()
.animate()
does not work. I tested it with background-color
too.
The funny thing is that it gives alert()
, but does not apply .animate()
when using click()
.
The other eventhandlers ( .mouseout() .mousemove() .mouseover()
...) function normally.
Does anyone know why this happens?
HTML:
<div class="menucontainer">
<ul class="gambiarraNav">
<li class="navli"><a href=""> <p class="navp">Home</p></a></li>
<li><a href=""><p class="navp">Pictures</p></a>
<ul>
<li><a href="">Sub tab 1</a></li>
<li><a href="">Sub tab 2</a></li>
<li><a href="">Sub tab 3</a></li>
<li><a href="">Sub tab 4</a></li>
</ul>
</li>
<li><a href=""><p class="navp">Asuka</p></a>
<ul>
<li><a href="">Sub tab 1</a></li>
<li><a href="">Sub tab 2</a></li>
<li><a href="">Sub tab 3</a></li>
<li><a href="">Sub tab 4</a></li>
</ul>
</li>
<li id="nervID"><a href="" ><p class="navp">Nerv</p></a></li>
</ul>
</div>
jQuery:
$('#nervID').mouseout(function(){
alert("entrou");
$('.page').animate({'opacity':'0.00'}, 300, 'linear');
});