I am designing a website and for effects I came across the below set of jquery code for achieve text color change with animation. But it doesn’t work and I am not sure what is wrong.
Below is the code that I’m currently experiencing the issue with:
jQuery:
$('.list-5 li a').hover(function() {
$(this).stop().animate({ color: '#fff' })
}, function() {
$(this).stop().animate({ color: '#0e1b23' })
})
HTML:
<div class="list-5">
<ul>
<li>
<a href="#">Hello world</a>
</li>
</ul>
</div>
#FFFFis an invalid color. Use either#FFFor#FFFFFF.Also, the default jQuery
.animatedoes not animate colors. You’ll have to use jQuery UI for that (or the Color plugin).