PDA

View Full Version : FLEXI Slideshow HELP



erinkuzma
06-01-2006, 05:15 PM
http://dynamicdrive.com/dynamicindex14/flexislide.htm


ok the script is only written for 3 images and im add 5 all together. when i do that the code gets messy and keeps writting UNDEFINED so i need help with the bottom half i think is where the problems are accuring. thanks


variableslide[0]=['images/newhomepage/forcesofnature_banner.gif', '', '']
variableslide[1]=['images/newhomepage/vforvendet_banner.gif', '','']
variableslide[2]=['images/newhomepage/sesamelarge_banner.gif', '','']
variableslide[3]=['images/newhomepage/bodiesbanner_rotate.gif', '','']
variableslide[4]=['images/newhomepage/spiderman_rotatebanner.gif', '','']
variableslide[5]=['images/newhomepage/ridearoundworld_banner.gif', '','']
//configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='450px' //set to width of LARGEST image in your slideshow
var slideheight='550px' //set to height of LARGEST iamge in your slideshow, plus any text description
var slidebgcolor='#ffffff' //background color
//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=2000 //the speed
////Do not edit pass this line////////////////
var ie=document.all
var dom=document.getElementById
for (i=0;i<variableslide.length;i++){
var cacheimage=new Image()
cacheimage.src=variableslide[i][0]
}
var currentslide=0
function rotateimages(){
contentcontainer='<center>'

if (variableslide[currentslide][1]!="")
contentcontainer+='<a href="'+variableslide[currentslide][1]+'">'
contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">'

if (variableslide[currentslide][1]!="")
contentcontainer+='</a>'
contentcontainer+='</center>'

if (variableslide[currentslide][2]!="")
contentcontainer+=variableslide[currentslide][2]


if (variableslide[currentslide][3]!="")
contentcontainer+=variableslide[currentslide][3]


if (variableslide[currentslide][4]!="")
contentcontainer+=variableslide[currentslide][4]

if (variableslide[currentslide][5]!="")
contentcontainer+=variableslide[currentslide][5]

if (document.layers){
crossrotateobj.document.write(contentcontainer)
crossrotateobj.document.close()
}
else if (ie||dom)
crossrotateobj.innerHTML=contentcontainer
if (currentslide==variableslide.length-1) currentslide=0
else currentslide++
setTimeout("rotateimages()",slidedelay)
}
if (ie||dom)
document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
if (document.layers)
document.slidensmain.visibility="show"
rotateimages()
}
if (ie||dom)
start_slider()
else if (document.layers)
window.onload=start_slider

//Easy as that!!
</script>

jscheuer1
06-01-2006, 07:56 PM
Looks to me that you have way over thought this. The only thing you should need to do is configure the array and user variables:


var variableslide=new Array()

//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]

variableslide[0]=['images/newhomepage/forcesofnature_banner.gif', '', '']
variableslide[1]=['images/newhomepage/vforvendet_banner.gif', '','']
variableslide[2]=['images/newhomepage/sesamelarge_banner.gif', '','']
variableslide[3]=['images/newhomepage/bodiesbanner_rotate.gif', '','']
variableslide[4]=['images/newhomepage/spiderman_rotatebanner.gif', '','']
variableslide[5]=['images/newhomepage/ridearoundworld_banner.gif', '','']
//configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='450px' //set to width of LARGEST image in your slideshow
var slideheight='550px' //set to height of LARGEST iamge in your slideshow, plus any text description
var slidebgcolor='#ffffff' //background color
//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=2000 //the speed
////Do not edit pass this line////////////////

What part of ////Do not edit pass this line//////////////// didn't you understand? It means stop editing!