PDA

View Full Version : multiple versions of a slideshow script on same page


gary
06-23-2003, 06:37 AM
Is there a way of running the same slideshow script more than once on the same page. Thanks for any suggestions - Gary

beetle
06-23-2003, 06:47 AM
yup (http://www.peterbailey.net/dhtml/oo_slideshow.htm)

It's my script - lemme know if you need help using it.

MotherNatrsSon
06-23-2003, 06:56 AM
What slideshow? All I see is a page divded into fourths, no images, no slideshow....

MNS

beetle
06-23-2003, 07:00 AM
You sure? It preloads images - maybe you didn't wait long enough.

MotherNatrsSon
06-23-2003, 07:29 AM
Yes I'm sure. Tried it again. I am on a MAC using Netscape 7.02 if that matters any......OS 9.2.2

MNS

beetle
06-23-2003, 07:32 AM
Not sure what to say. I just re-tested it in Mozilla 1.3 and it works fine. Does Netscape give you any useful error message of any kind?

MotherNatrsSon
06-23-2003, 07:38 AM
I get no error messages at all out of netscape but in IE 5.1.6 for MAC i get an error code.

Line 328
Chaacter 1
Object does not support this property or method.

Just so you know I have had similar problems with pages that I have scripts on because of putting the doctype at the top of the page. I am willing to bet some money that if you removed the doctype they would ork fine.

MNS

gary
06-23-2003, 07:42 AM
I looked at the slideshow script at http://www.peterbailey.net/dhtml/oo_slideshow.htm.

Doesn't this script require slideshow.class.js and timer.class.js on my server to make this script work??

Gary

beetle
06-23-2003, 07:43 AM
yes, it does. They can both be downloaded/viewed from my JS Classes (http://www.peterbailey.net/dev/jsclassses/) page.

gary
06-23-2003, 08:08 AM
Did your slideshow example show 4 different ways of using this script and if I wanted to use just one of the examples shown could I name the last example this way var ss1, var ss2, etc and delete the 1st three examples??

I would end up with something like this:

var ss1 = new SlideShow( 'slide4','','','','http://www.mysite.com/archive/2003/','pvpData',0,1);
ss1.makeButtons( 'ssNav1', 0, 0, 0, 0, 0, 1, 0 );
ss1.makeStatus( 'ssNav1', 'span' );
ss1.first();

var ss2 = new SlideShow( 'slide4','','','','http://www.mysite.com/archive/2003/','pvpData',0,1);
ss2.makeButtons( 'ssNav2', 0, 0, 0, 0, 0, 1, 0 );
ss2.makeStatus( 'ssNav2', 'span' );
ss2.first();

also. . . . how do I change this part "pvpData" for my use.

Gary

beetle
06-23-2003, 08:14 AM
The parameters break down as as follows

function SlideShow( imgId, linkId, capId, stsId, root, data, pre, loop )

imgId = the ID of the image the slideshow uses
linkId = the ID of the link the slideshow uses
capId = the ID of the caption element for the show
stsId = the ID of the status element for the show
root = the root of all the image files
data = an array of slideshow data
pre = preload images toggle
loop = looping toggle

The extra functions, makeButtons() or makeStatus() are for constructon of the control widgets. What would you like to use?

The data is simple. It's a two-dimensional array - the first index of each sub array being the image name and extension, the 2nd piece being the caption for the image, the 3rd being a link for the image (if used).

Lemme know if you need more help. I just haven't had the time to document this script.

gary
06-23-2003, 08:07 PM
This what I have done so far just to get it working, will make final revisions later. How & where do I adjust the number of images per each slideshow. The default now is 3.

Gary

<html>
<head>
<title>Slideshow</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="gary@classic-camera.com" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta http-equiv="imagetoolbar" content="no" />
<script type="text/javascript" src="js/slideshow.class.js"></script>
<script type="text/javascript" src="js/timer.class.js"></script>
<script type="text/javascript">
function init()
{
var ss1 = new SlideShow( 'slide1','','','','http://www.classic-camera.com/images4/','cam1Data',0,1);
ss1.makeButtons( 'ssNav1', 0, 0, 0, 0, 0, 1, 0 );
ss1.makeStatus( 'ssNav1', 'span' );
ss1.first();

var ss2 = new SlideShow( 'slide2','','','','http://www.classic-camera.com/images4/','cam2Data',0,1);
ss2.makeButtons( 'ssNav2', 0, 0, 0, 0, 0, 1, 0 );
ss2.makeStatus( 'ssNav2', 'span' );
ss2.first();
}

var cam1Data = [

['1912kodak1.gif','CAM 1'],
['1912kodak2.gif','CAM 2'],

];

var cam2Data = [

['1912kodak1.gif','CAM 1'],
['1912kodak2.gif','CAM 2'],

];

</script>

<style type="text/css">
html, body {
font: 1em Verdana, Arial, sans-serif;
color: black;
background-color: FFCC99;
}
</style>
</head>

<body onload="init();">
<table align="center" cellpadding="0" cellspacing="0" border="0" width="750" bgcolor="FFCC99"><tr><td>
<table align="center" cellpadding="0" cellspacing="0" border="0" width="700" bgcolor="FFCC99">
<tr><td align=center></div><img src="" id="slide1" width="141px" height="213px" /><div id="ssNav1"></td>
<td><div id="ssNav2"></div><img src="" id="slide2" width="141px" height="213px" /></td></tr>
</table>
</td></tr></table>
</body>
</html>

beetle
06-23-2003, 08:16 PM
Just make the array any size you want. It's the size of the array that determines the number of slides.

gary
06-23-2003, 08:38 PM
I have zero knowledge regarding Java scripts so you are way over my head when you are speaking about "array". If you could point me to the line in the script and how to adjust it would help.

Thanks, Gary

beetle
06-23-2003, 08:56 PM
hehe, okay


var cam1Data = [
['1912kodak1.gif','CAM 1'], // This is slide 1
['1912kodak2.gif','CAM 2'], // This is slide 2
['1912kodak3.gif','CAM 3'] // This is slide 3
];
Make sure to notice that the last slide doesn't have a comma after it.

gary
06-23-2003, 09:19 PM
Thank you - yea I know it must be annoying dealing with java deadheads but I appreciate your following through with me - Gary