Scriptaculous JavaScript slideshow
1 var album = { 2 startup: function() { 3 new PeriodicalExecuter(album.cycle, 5) // change image every 5 seconds 4 }, 5 cycle: function() { 6 new Effect.Fade('image', { // the id of the <DIV> containing the photos 7 duration: 1, 8 fps: 50, 9 afterFinish: function() { 10 new Ajax.Updater('image','/album/next', { // URL for next <IMG> tag 11 asynchronous: true, 12 onSuccess: function() { 13 new Effect.Appear('image', { 14 duration: 1, 15 fps: 50, 16 queue:'end' 17 }) 18 } 19 }) 20 } 21 }) 22 } 23 } 24 25 window.onload = album.startup
I want to tweak it so that an earlier event precaches the next image instead.