PDA

View Full Version : Flexi slideshow



bubha
11-24-2006, 05:33 AM
I have tried to use the flexi slideshow http://dynamicdrive.com/dynamicindex14/index.html

I try to replace the images in the array with my own images, excepting the middle one, and all I get is a weird scripting, and then is replaced by the words 'have the aliens landed yet, you decide?' Obviously the text from variableslide[1]

I am trying to get it to work in dreamweaver 8. I use Firefox to view the pages.

Here is a copy from my page in Dreamweaver.

Any Help:rolleyes:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

<script language="JavaScript1.2">

/***********************************************
* Flexi Slideshow- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var variableslide=new Array()

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

variableslide[0]=['<img src="Slideshow picts/picts/altice 10.jpg">','so is this here?']
variableslide[1]=['spaceship.gif', 'http://www.space.com', 'Has aliens landed on earth? You decide.']
variableslide[2]=['<img src="Slideshow picts/picts/altice 2.jpg">']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth='760px' //set to width of LARGEST image in your slideshow
var slideheight='800px' //set to height of LARGEST iamge in your slideshow, plus any text description
var slidebgcolor='#F3F3F3'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=3000

////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 (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

</script>

<ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; bgColor=&{slidebgcolor}; visibility=hide><layer id="slidenssub" width=&{slidewidth}; left=0 top=0></layer></ilayer>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
</body>
</html>

codeexploiter
11-24-2006, 05:59 AM
Replace the following code segment in your source code



variableslide[0]=['<img src="Slideshow picts/picts/altice 10.jpg">','so is this here?']
variableslide[1]=['spaceship.gif', 'http://www.space.com', 'Has aliens landed on earth? You decide.']
variableslide[2]=['<img src="Slideshow picts/picts/altice 2.jpg">']


problamatic lines are in red color.

You don't have to specify the <img> tag within the array just name your image file along with its correct path

for example:



variableslide[0]=['1.jpg','','so is this here?']
variableslide[1]=['3.gif', '', 'Has aliens landed on earth? You decide.']
variableslide[2]=['2.jpg','','hello']


In the above code 1.jpg, 3.gif and 2.jpg files are stored in the same folder where i've stored flexi slide show web page.

You can find the difference in your code and the one I've mentioned here.

bubha
11-24-2006, 06:13 AM
Thanks!

Answers are so easy when you know them;

So difficult when you do not.