I have a set of divs with a hovering effect, but if you hover over them quickly the animation just gets messy. This is the HTML:
<a>
<div class="project">
<img src="img/projects/TrendyPhones.png" alt="project screenshot">
<h3>Trendy Phones</h3>
</div>
</a>
<a href="">
<div class="project">
<img src="img/projects/TrendyPhones.png" alt="project screenshot">
<h3>Trendy Phones</h3>
</div>
</a>
<a href="">
<div class="project">
<img src="img/projects/TrendyPhones.png" alt="project screenshot">
<h3>Trendy Phones</h3>
</div>
$(document).ready(function(){
$('.project').hover(function(){
$(this).find('h3').fadeIn(500);
}, function(){
$(this).find('h3').fadeOut(500);
});
});
Try to .stop()
the running animation before beginning the newer one.
$(document).ready(function(){
$('.project').hover(function(){
$(this).find('h3').stop().fadeIn(500);
}, function(){
$(this).find('h3').stop().fadeOut(500);
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With