Can you create an animation for changing the background color when clicking on an element? Most examples I've found use mouseover/hover functions, but none with a click function. The following line changes the background color without any animation:
$('#element').css({ backgroundColor: "#99cc00" });
I attempted to add an animation effect with:
$('#element').animate({ backgroundColor: '#ffffff' }, 2000);
and
$('#element').css({ backgroundColor: "#99cc00" }).animate({}, 2500);
However, these attempts did not produce the desired effect. Here is the jsfiddle link for reference: http://jsfiddle.net/dna6B/
Any suggestions?