Le añadí una transición para que el cambio del fondo se vea más estético.
Código Javascript
:
Ver originalvar img = ['imagen1.jpg', 'imagen2.jpg', 'imagen3.jpg', 'imagen4.jpg', 'imagen5.jpg'],
total = img.length,
index = 0;
document.body.style.background = "url('" + img[index] + "') no-repeat center center fixed";
document.body.style.backgroundSize = "cover";
document.body.style.transition = "background .8s";
var fondo = {
rotar: function(){
index = index == total - 1 ? 0 : ++index;
document.body.style.background = "url('" + img[index] + "') no-repeat center center fixed";
document.body.style.backgroundSize = "cover";
document.body.style.transition = "background .8s";
}
};
setInterval(fondo.rotar, 15000);
Ahora mira cómo se ve:
DEMO
No olvides marcar el tema como solucionado para que otras personas que tengan el problema que inicialmente tuviste, sepan que aquí pueden encontrar una solución.
Saludos