(function(images, elements) {
var fetchImages = function() {
if(images.length > 0) {
var numImages = 10;
while(images.length > 0 && numImages-- > 0) {
// assuming your elements are <img>
document.getElementById(elements.shift()).src = images.shift();
// if not you could also set the background (or backgroundImage) css property
// document.getElementById(elements.shift()).style.background = "url(" + images.shift() + ")";
}
setTimeout(fetchImages, 5000);
}
}
// bind to window onload
window.onload = fetchImages;
// if you're going to use something like jquery then do something like this instead
//$(fetchImages);
}(['url1', 'url2', 'url3'], ['img1', 'img2', 'img3']))
そのような何かが、あなたが求めていることをするだろうと私は思います。
最後の行はおそらく次のようなものに置き換えられます
}(<%=ImageUrls %>, <%=ImageElements %>))