Use hoverand animate. Please note that this requires a jQuery animation plugin.
<html>
<head>
<title>color change</title>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script src="http://plugins.jquery.com/files/jquery.color.js.txt" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$('a').hover(function() {
$(this).animate({
color: "#f00"
}, "fast")
}, function() {
$(this).animate({
color: "#00f"
}, "fast")
});
});
</script>
<style>
a { color: #00f; }
</style>
</head>
<body>
<a href="#">This changes color on hover.</a>
</body>
</html>
In the example of a color change in an element, athere is no reason to use the crossfade effect used in the provided link.
source
share