Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Templates and slideshow script

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to run a slide show script in a template--The code below works in the template itself but not in the files attached to it--In the regular files, no picture shows--The problem seems to be the image file names--but I've tried editing the code with ../images/picture.jpg and /images/picutre.jpg--I remember reading that layers could not be used in a template but this is a script--I didn't think it would be a problem--Any ideas--

IN HEAD
<script language=&quot;JavaScript1.1&quot;>
<!--

var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages=new Image()
slideimages.src=slideshowimages.arguments
}
}

function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks=slideshowlinks.arguments
}

function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}

//-->
</script>

IN BODY
<td rowspan=&quot;4&quot; valign=&quot;top&quot;>&nbsp;<img src=&quot;../images/literacy.jpg&quot; name=&quot;slide&quot; border=0 width=120 height=85>
<script>
<!--

//configure the paths of the images, plus corresponding target links
slideshowimages(&quot;../images/literacy.jpg&quot;,&quot;../images/homework2.jpg&quot;,&quot;../images/circgroup.jpg&quot;,&quot;../images/familypl.jpg&quot;,&quot;../images/computergroup.jpg&quot;)


//configure the speed of the slideshow, in miliseconds
var slideshowspeed=4000

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(&quot;slideit()&quot;,slideshowspeed)
}
slideit()

//-->
</script>
 
I see the problem--when I preview the page in the browser, the script is running, with no picture and I click properties, each image file comes up with this path--file:///C:/familypl.jpg--why would using the template change the path and how can I fix it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top