why can't I get this slide show to work?

  mco 20:11 15 Oct 2005
Locked

I found this bit of cut+paste ..click here

and I fancied trying it out on my site, but all I can get when I preview is the text and link of their ad 'dynamic drive' , in the correct place, but no pics or slide show. Below is how I've altered it - can anyone spot what I've done wrong? (I've uploaded the photos to my site and they are there so the links ought to work)

script language="JavaScript1.2">

//Presentational Slideshow Script- By Dynamic Drive
//For full source code and more DHTML scripts, visit click here
//This credit MUST stay intact for legal use

var slideshow_width='173px' //SET SLIDESHOW WIDTH (set to largest image's width if multiple dimensions exist)
var slideshow_height='142px' //SET SLIDESHOW HEIGHT (set to largest image's height if multiple dimensions exist)
var pause=3000 //SET PAUSE BETWEEN SLIDE (2000=2 seconds)
var slidebgcolor="white"

var dropimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
dropimages[0]="click here"
dropimages[1]="click here"
dropimages[2]="click here"
dropimages[3]="click here"
dropimages[4]="click here"
var droplinks=new Array()
//SET IMAGE URLs. Use "" if you wish particular image to NOT be linked:
droplinks[0]=""
droplinks[1]=""
droplinks[2]=""
droplinks[3]=""
droplinks[4]=""

////NO need to edit beyond here/////////////

var preloadedimages=new Array()
for (p=0;p dropimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=dropimages[p]
}

var ie4=document.all
var dom=document.getElementById

if (ie4||dom)
document.write(' div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"> div
id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';background-color:'+slidebgcolor+';left:-'+slideshow_width+'"> /div> div
id="canvas1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';background-color:'+slidebgcolor+';left:-'+slideshow_width+'"> /div> /div>')
else
document.write(' a href="javascript:rotatelink()"> img name="defaultslide" src="'+dropimages[0]+'" border=0> /a>')

var curpos=parseInt(slideshow_width)*(-1)
var degree=10
var curcanvas="canvas0"
var curimageindex=linkindex=0
var nextimageindex=1


function movepic(){
if (curpos 0){
curpos=Math.min(curpos+degree,0)
tempobj.style.left=curpos+"px"
}
else{

clearInterval(dropslide)
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
var slideimage=' img src="'+dropimages[curimageindex]+'" border=0>'
tempobj.innerHTML=(droplinks[curimageindex]!="")? ' a href="'+droplinks[curimageindex]+'">'+slideimage+' /a>' : slideimage
nextimageindex=(nextimageindex dropimages.length-1)? nextimageindex+1 : 0
setTimeout("rotateimage()",pause)
}
}

function rotateimage(){
if (ie4||dom){
resetit(curcanvas)
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
var temp='setInterval("movepic()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else
document.images.defaultslide.src=dropimages[curimageindex]
linkindex=curimageindex
curimageindex=(curimageindex dropimages.length-1)? curimageindex+1 : 0
}

function rotatelink(){
if (droplinks[linkindex]!="")
window.location=droplinks[linkindex]
}

function resetit(what){
curpos=parseInt(slideshow_width)*(-1)
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
crossobj.style.left=curpos+"px"
}

function startit(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML=' a href="'+droplinks[curimageindex]+'"> img src="'+dropimages[curimageindex]+'" border=0> /a>'
rotateimage()
}

if (ie4||dom)
window.onload=startit
else
setInterval("rotateimage()",pause)

/script>

p align="center"> font face="Arial" size="-2">Free DHTML scripts provided by br>
a href="click here">Dynamic Drive /a> /font> /p>

  mco 20:13 15 Oct 2005

well I see the photos come out here, so why not on my site as a slideshow?

  mco 23:15 15 Oct 2005

well, I changed the wording for the photos as I noticed all my others on the site had been automatically put into http:// hpbimg by the webbuilder program - so I put mine there, tried it again and still nothing. So I tried another slide show script and still nothing. So what am I missing?

  djinn 21:42 20 Oct 2005

Hey,

I don't know if you have resolved or abandoned this but I couldn't find the script on either your prestonrespect index page or the linked pages I followed to view.

Could it be that you were going to externalise the script and that script hasn't been linked to??

Cheers

  mco 23:46 20 Oct 2005

I downloaded some windows power toy that did slide shows and put that up instead, with a link 'watch slide show here' not at all how I intended but I needed to get something up at the time. Original problem still unresolved though.

click here

  djinn 12:58 21 Oct 2005

I'm no js guru - but perhaps you need to point to the images directly - don't use the full http address. Like ../images/image1.jpg etc

HTH
Cheers

  mco 23:48 22 Oct 2005

I've still not sorted this one; your suggestion didn't work djinn , pity. I'm sure I must be doing something wrong that's something simple - is usually the case with me.

  djinn 01:24 23 Oct 2005

Hey,

click here

That's your images working with the script - if the images were exactly the same size it would look better, you'll see what I mean when you visit the page.

Anyway I've zipped the page for you to download - link for the zip is on the page.

Just copy the code - make sure your pics are in the same directory as your page and your good to go.

HTH
Cheers

  mco 02:36 23 Oct 2005

wow! Thanks! Except I can see the photos fine but... it says page not found when I click on the zip link, which is a shame because I'm really keen to see the code now!

  mco 02:43 23 Oct 2005

I looked at 'view source' and although all five photos are there, as in my original code, only three of them are actually in the slide show..wonder why that might be?

  mco 03:14 23 Oct 2005

I think I've got the page myself after all and zipped it thanks - I just fiddled about in the address bar when I saw what you'd called it. Still don't get why it won't show up all 5 though!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

What is ransomware and how do I protect my PC from Petya?

Microsoft Surface Studio – the artist's hands-on review

Original iPhone review

Comment mettre à jour Kodi ?