I’m trying to build a background animation with jQuery which changes from one gradient to another. I know you can use the .animate() function to change solid background colors, but can this also be done for gradients?
Here’s a good example from some old Digg-style comments. I’m looking to do something like this animating from green to yellow

UPDATE: These days, all major browsers support CSS animations, which are way more reliable than jQuery. For reference, see Rohit’s answer.
OLD ANSWER:
Animating the backgrounds directly is nearly impossible with jQuery, at least I could think of no way. There is a way though with this:
That ensures that there is a transition. You could for instance do that in CSS:
And, using jQuery, either add or remove the yellow class:
That would ensure a gradual transition due to the transition duration property in the CSS file.