Background Color Fade
Fades the background color. Useful for an easy Yellow Fade Technique for AJAX events.
CSS
.test {background:#ddd; display:inline-block; padding:10px; font-size:2em;}
JavaScript
$.fn.bgColorFade = function(userOptions) {
// starting color, ending color, duration in ms
var options = $.extend({
start: "#fff79f",
end: "#fff",
time: 2000
}, userOptions || {});
$(this).css({
backgroundColor: options.start
}).animate({
backgroundColor: options.end
}, options.time);
return this;
};
$(".test").bgColorFade({
time: 6000
});