change the background of an element in a loop using css
var colors = ['blue', 'green', 'yellow', 'black'],
colorIndex = 0,
$body = $('body');
setInterval(function(){ $body.css('background', colors[colorIndex++ % colors.length])}, 1000);