Hey guys,
I too was looking for a css background element slideshow, Thanks for your input. I explored your solution with the setTimeout method, however had massive troubles with it (I'm a noob).
I've adapted peirix's solution with a setInterval alternative and came up with this;
var bgArr = ["images/TopImage-01.jpg", "images/TopImage-02.jpg", "images/TopImage-03.jpg" ];
var i=0;
// Start the slide show
var interval = self.setInterval("swapBkgnd()", 5000)
function swapBkgnd() {
if (i>(bgArr.length-1) ) {
i=0
$("#header").css("background-image", "url("+bgArr[i]+")");
}
else {
$("#header").css("background-image", "url("+bgArr[i]+")");
}
i++;
};
Now I need to add a fade effect and image preloader and I'll be away. Would be interested to know if there's a tidier way to achieve this.
Cheers,
Dave