Hey !
I need a script to show random pic and i need a bit of help.
I found a script, and I changed it a bit but i need to to random the names of the pics too. i will explain.
I got pics in a directory let's say Images, that are numbered,like1205.jpg, 1206.jpg, etc... and I want the script to random me anumberfrom 2067-2089 (the name of the pics I want to random). and showthemrandomaly... but I got a problem doin it.
This is the script i got... how can i upgrade it for my needs ?
Anyone ?
I need a script to show random pic and i need a bit of help.
I found a script, and I changed it a bit but i need to to random the names of the pics too. i will explain.
I got pics in a directory let's say Images, that are numbered,like1205.jpg, 1206.jpg, etc... and I want the script to random me anumberfrom 2067-2089 (the name of the pics I want to random). and showthemrandomaly... but I got a problem doin it.
This is the script i got... how can i upgrade it for my needs ?
Code:
<script language="JavaScript">
<!--
function random_images(){
var myimages=new Array()
myimages[1]="1.jpg"
myimages[2]="2.jpg"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<img src="'+myimages[ry]+'" border=0>')
}
//-->
</script>
<SCRIPT language="JavaScript">
<!--
random_images()
//-->
</SCRIPT>
Anyone ?