Hey guys,
Long time reader first time poster. I just had a question about a Java script I am trying to use.
Basically its an image swap script. I have an image that is properly swapping at the top of the page, however I want to use it once more on another image. I am not a java guy - I tried playing with it with a few diff combos of duplicating the code and it just blows out everything. If anyone could tell me how to do multiple instances of swapping on the same page that would rock. Also if there is a better script out there I am open to that too. Thanks in advance!
The script can be found here: (Cant post it because I dont have 15 posts...)
Here is the code:
This goes in the header:
Quote:
<script language="JavaScript1.1">
<!--
var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages[i]=new Image()
slideimages[i].src=slideshowimages.arguments[i]
}
}
function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks[i]=slideshowlinks.arguments[i]
}
function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}
//-->
</script>
|
This goes in the body:
Quote:
<a href="javascript:gotoshow()"><img src="" name="slide" border=0 width=300 height=375></a>
<script>
<!--
//configure the paths of the images, plus corresponding target links
slideshowimages("food1.jpg","food2.jpg","food3.jpg ","food4.jpg","food5.jpg")
slideshowlinks("")
//configure the speed of the slideshow, in miliseconds
var slideshowspeed=2000
var whichlink=0
var whichimage=0
function slideit(){
if (!document.images)
return
document.images.slide.src=slideimages[whichimage].src
whichlink=whichimage
if (whichimage<slideimages.length-1)
whichimage++
else
whichimage=0
setTimeout("slideit()",slideshowspeed)
}
slideit()
//-->
</script>
<p align="center"><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="">JavaScript
Kit</a></font></p>
|