Sorry, my Javascript skills have become too rusty ...
... can someone be kind enough to remind me how to cycle endlessly through an array of images every n seconds so that a div background changes every 5 seconds?
I'm stuck here :
Thanks A LOT
... can someone be kind enough to remind me how to cycle endlessly through an array of images every n seconds so that a div background changes every 5 seconds?
I'm stuck here :
Code:
var pics = new Array('pic_1.png', 'pic_2.png');
for (var i = 0; i < pics.length; i++) {
document.getElementById('my_pics').style.backgroundImage = 'url(my_dir/'+ pics[i] +')';
}
Thanks A LOT