Solution without any additional plugins
1. Add this CSS:
nav li {
-webkit-transition:color 1s ease;
-moz-transition:color 1s ease;
-o-transition:color 1s ease;
transition:color 1s ease;
}
.white_color { color:#fff; }
You can modify 1s to whatever time value you want, you can also use ms if you like.
2. Use this jQuery code:
$(document).ready(function () {
$("nav a").mouseenter(function () {
if ($(this).data('fading')) //EXIT IF WE ARE FADING
return;
$('div', this).stop(true, false).animate({
'height': '45px'
}, 100);
$('li', this).addClass('white_color'); // THIS IS THE LINE I'M AFTER - I want the color to change smoothly, not instantly
$('li', this).stop(true, false).animate({
'padding-top': '15px'
}, 200);
}).mouseleave(function () {
if ($(this).data('fading')) return;
$('li', this).removeClass('white_color');
$('div', this).stop(true, false).animate({
'height': '0px'
}, 300);
$('li', this).stop(true, false).animate({
'padding-top': '65px'
}, 500);
});
});
jsFiddle demo.