i wanna dynamically change the link color within a hover event. I got the following code so far but it doesn´t work. Any suggestions why? In my oppinion it seems to be right...
$('.fadelink').hover(function(){
$(this).animate({
color: '#333'
}, 600);
},
function(){
$(this).animate({
color: '#999'
}, 600);
});
You have to add colors plugin to make it work. That is stripped from core.
jQuery doesn't support animation of colors, but it can with the color plugin: http://plugins.jquery.com/project/color
However, there's another route you could take, with CSS3, if you don't mind it not working in some older browsers:
.baseClass {
color:#999;
-webkit-transition-property:color;
-webkit-transition-duration: 1s, 1s;
-webkit-transition-timing-function: linear, ease-in;
}
.baseClass:hover {
color: #333;
}
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