I found JavaScript scripts for displaying random images and randomizing the setInterval function. I was able to get them to work together, but the images are changing too quickly. I want the images to change randomly between 1 minute and 10 minutes.
function randomImage() {
var fileNames = [
"http://i.imgur.com/YibF8aO.jpg",
"http://ryanlb.com/images/other/images/getter-dragon-2.jpg",
"http://i.imgur.com/JMgKg9O.jpg"
];
var randomIndex = Math.floor(Math.random() * fileNames.length);
document.getElementById("background").style.background = 'url(' + fileNames[randomIndex] + ')';
}
function doSomething() {}
(function loop() {
var rand = Math.round(Math.random() * 9999999999 );
setTimeout(function() {
doSomething();
loop();
}, rand);
}());
randomImage();
setInterval(randomImage, doSomething());
WARNING: The images in the jsfiddle demo are flashing and rotating very quickly! Check out the jsfiddle example here