Basically what I need is an easy way to change the background image of a page every 5 seconds and with a fade effect. The problem that I am having is that I want to do this using my main body tag and I have this CSS:
body {
background: url("images/bg-home.jpg") no-repeat scroll center top #000000;
}
So the cycle needs to change this div to bg-home-1.jpg, bg-home-2.jpg etc... and this will have to be dynamic as each page has a different number of images so I can't use this way of doing it:
<div id="fading-images">
<img src="img/home-1.jpg">
<img src="img/home-2.jpg">
<img src="img/home-3.jpg">
</div>
setInterval(function(){
$('#fading-images:first-child').fadeOut('slow')
.next('img').fadeIn('slow')
.end().appendTo('#slideshow');},
4000);
}
Hopefully someone can help me :)