我不确定下一个颜色的来源,所以这里是一个使用随机颜色的示例:
$('p').click(function() {
$(this).animate({
'color': 'rgb('+ (Math.floor(Math.random() * 256)) +','+
(Math.floor(Math.random() * 256)) +','+
(Math.floor(Math.random() * 256)) +')'
}, 500);
});?
Run Code Online (Sandbox Code Playgroud)
如果您不希望它像我一样动画,只需更改.animate()为.css()并且更改将是即时的,就像这样.