W
Whitney
I ran across a chunk of code that allows me to blend images in and out
(works great!) but now I need to figure out a way to randomize the
order that these images appear. I have a bunch of pics and I'd like
to give them all a fair shot at getting seen =)
Any help would be GREATLY appreciated!!
Here's the code:
<HEAD>
<script language="JavaScript1.1">
<!--
//specify interval between slide (in mili seconds)
var slidespeed=3000
//specify images
var slideimages=new Array("image1.gif","image2.gif","image3.gif")
//specify corresponding links
var slidelinks=new Array("http://www.whatever.com","http://whatnever.com","http://www.always.com")
var newwindow=1 //open links in new window? 1=yes, 0=no
var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder=new Image()
imageholder.src=slideimages
}
function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}
//-->
</script>
</HEAD>
<BODY>
<a href="javascript:gotoshow()"><img src="image1.gif" name="slide"
border=0 style="filter:blendTrans(duration=3)" width=97
height=100></a>
<script language="JavaScript1.1">
<!--
var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 :
0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()
//-->
</script>
(works great!) but now I need to figure out a way to randomize the
order that these images appear. I have a bunch of pics and I'd like
to give them all a fair shot at getting seen =)
Any help would be GREATLY appreciated!!
Here's the code:
<HEAD>
<script language="JavaScript1.1">
<!--
//specify interval between slide (in mili seconds)
var slidespeed=3000
//specify images
var slideimages=new Array("image1.gif","image2.gif","image3.gif")
//specify corresponding links
var slidelinks=new Array("http://www.whatever.com","http://whatnever.com","http://www.always.com")
var newwindow=1 //open links in new window? 1=yes, 0=no
var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder=new Image()
imageholder.src=slideimages
}
function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}
//-->
</script>
</HEAD>
<BODY>
<a href="javascript:gotoshow()"><img src="image1.gif" name="slide"
border=0 style="filter:blendTrans(duration=3)" width=97
height=100></a>
<script language="JavaScript1.1">
<!--
var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 :
0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()
//-->
</script>