This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var photos = ['Resources/P5240181.JPG','Resources/P5240182.JPG','Resources/P5240183.JPG']; | |
var FREQUENCY = 5; //seconds | |
photos.each(function(elm,idx){ | |
var path = elm.toString(); | |
photos[idx] = new Image(); //preload for faster transitions | |
photos[idx].src = path; | |
}); | |
var idx = 0; | |
new PeriodicalExecuter(function(){ | |
idx = (idx + 1 < photos.length) ? idx + 1 : 0; | |
$(document.body).setStyle('background-image:url(' + photos[idx].src + ')'); | |
},FREQUENCY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment