PDA

View Full Version : Blending Image Slideshow Script not working



rjneuzel
04-12-2007, 12:46 AM
1) Script Title: Blending Image Slideshow Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/image4.htm

3) Describe problem:
I am trying to add my pictures into the script but I am not sure how to associate them. In the example they have the images titled:image1.gif","image2.gif","image3.gif

Mine are titled like: "truck.jpeg", "main_front.jpeg", etc.
I guess my main question is where should my image files be located? I just have them in the same folder(on my computer) as my index file.
How do I get it so that the script knows where to find my files?

Thanks for you help.

rjneuzel

thetestingsite
04-12-2007, 12:50 AM
It pretty much doesn't matter where you place them (directory wise), as long as you reference them in the script (on this line in the code):


var slideimages=new Array("truck.jpeg","main_front.jpeg")

and also on this line (the first image listed in the array above):



<a href="javascript:gotoshow()"><img src="truck.jpeg" name="slide" border=0 style="filter:blendTrans(duration=3)" width=97 height=100></a>


Hope this helps.

rjneuzel
04-12-2007, 10:46 PM
Thanks, for some reason that still didn't work. I will copy the html script below. I'm sure I am just missing something easy.

Thanks for your help!
rjneuzel

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title><br>
<script language="JavaScript1.1">
<!--

//*****************************************
// Blending Image Slide Show Script-
// Dynamic Drive (www.dynamicdrive.com)
// For full source code, visit http://www.dynamicdrive.com/
//*****************************************

//specify interval between slide (in mili seconds)
var slidespeed=3000

//specify images
var slideimages=new Array("truck.jpeg","main_front")

//specify corresponding links
var slidelinks=new Array("http://www.dynamicdrive.com","http://javascriptkit.com","http://www.geocities.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[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body><br>
<a href="javascript:gotoshow()"><img src="truck.jpeg","main_front.jpeg" 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>



</body>
</html>

rjneuzel
04-14-2007, 02:51 AM
Any help would be appriciated.
Thank you!
rjneuzel

thetestingsite
04-14-2007, 02:53 AM
In the code you posted above, shouldn't this (the part in red):



var slideimages=new Array("truck.jpeg","main_front")


be this:



var slideimages=new Array("truck.jpeg","main_front.jpeg")

Hope this helps.

rjneuzel
04-14-2007, 04:43 PM
OK. call me an idiot. I didn't save it before previewed it in the browser. I feel foolish!!! Thanks so much for your help!!!

rjneuzel