MustangManny
MIS
<script language=vbs>
dim myPics
sub setPics()
myPics = array ("Pic1.jpg","Pic2.jpg","Pic3.jpg","Pic4.jpg","Pic5.jpg"
outStr = ""
randomize()
do while uBound(myPics) > 0
ranNum = fix(Rnd() * (uBound(myPics)+1))
outStr = outStr & "<img src='" & myPics(ranNum) & "' title='" & myPics(ranNum) & "'>"
resetArray(ranNum)
loop
'add remaining picture
outStr = outStr & "<img src='" & myPics(0) & "' title='" & myPics(0) & "'>"
document.getElementById("picPlace"
.innerHTML = outStr
end sub
sub resetArray(usedVal)
dim tempArr(), arrCount
arrCount = 0
for x = 0 to uBound(myPics)
if x <> usedVal then
redim preserve tempArr(arrCount)
tempArr(arrCount) = myPics(x)
arrCount = arrCount + 1
end if
next
redim myPics(uBound(tempArr))
for x = 0 to uBound(tempArr)
myPics(x) = tempArr(x)
next
end sub
</script>
<body onLoad="setPics()">
<div id="picPlace"></div>
Thanks in advance!
dim myPics
sub setPics()
myPics = array ("Pic1.jpg","Pic2.jpg","Pic3.jpg","Pic4.jpg","Pic5.jpg"
outStr = ""
randomize()
do while uBound(myPics) > 0
ranNum = fix(Rnd() * (uBound(myPics)+1))
outStr = outStr & "<img src='" & myPics(ranNum) & "' title='" & myPics(ranNum) & "'>"
resetArray(ranNum)
loop
'add remaining picture
outStr = outStr & "<img src='" & myPics(0) & "' title='" & myPics(0) & "'>"
document.getElementById("picPlace"
end sub
sub resetArray(usedVal)
dim tempArr(), arrCount
arrCount = 0
for x = 0 to uBound(myPics)
if x <> usedVal then
redim preserve tempArr(arrCount)
tempArr(arrCount) = myPics(x)
arrCount = arrCount + 1
end if
next
redim myPics(uBound(tempArr))
for x = 0 to uBound(tempArr)
myPics(x) = tempArr(x)
next
end sub
</script>
<body onLoad="setPics()">
<div id="picPlace"></div>
Thanks in advance!