So, I want to have a slideshow for my loading screen, but I am not too sure how I would do it.
I used Imgur for an album, and used this:
[CODE]
<iframe class="imgur-album" width="100%" height="550" frameborder="0" src="http://imgur.com/a/vxdQt/embed"></iframe>
[/CODE]
But that has buttons, it doesn't move automatically. And you can't click anything on the loading screen.
[url]http://stackoverflow.com/questions/9484018/display-images-from-a-folder-slideshow[/url]
Google is your friend. Try it first.
You can't click a loading screen.
I ended up doing a pretty simple JavaScript script.
For anyone who wants it, here you go!
It even selects a random image too!
[CODE]
<script language="javascript">
var delay=7500 //set delay in miliseconds
var curindex=0
var randomimages=new Array()
randomimages[0]="DarkRP1.png"
randomimages[1]="DarkRP2.png"
randomimages[2]="DarkRP3.png"
randomimages[3]="DarkRP4.png"
randomimages[4]="DarkRP5.png"
randomimages[5]="DarkRP6.png"
randomimages[6]="DarkRP7.png"
randomimages[7]="DarkRP8.png"
randomimages[8]="DarkRP9.png"
randomimages[9]="DarkRP10.png"
randomimages[10]="DarkRP11.png"
randomimages[11]="DarkRP12.png"
randomimages[12]="DarkRP13.png"
randomimages[13]="DarkRP14.png"
var preload=new Array()
for (n=0;n<randomimages.length;n++)
{
preload[n]=new Image()
preload[n].src=randomimages[n]
}
document.write('<img name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">')
function rotateimage()
{
if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){
curindex=curindex==0? 1 : curindex-1
}
else
curindex=tempindex
document.images.defaultimage.src=randomimages[curindex]
}
setInterval("rotateimage()",delay)
</script>
[/CODE]
Sorry, you need to Log In to post a reply to this thread.