PDA

View Full Version : Ultimate Fade-In Slideshow v1.5



Digihound
01-28-2006, 02:36 PM
Could you please confirm the syntax for the arrays when setting up multiple slideshows. I've set up a couple of slideshows but can only get the first of the two to work whether I put them in divs, tables or just flat on the page. The second one just won't operate.
Your guidelines are as follows:

var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["../dynamicindex4/bs00825a.gif", "http://www.wired.com", ""]
fadeimages2[1]=["../dynamicindex4/bs00847a.gif", "http://www.theregister.com", ""]
fadeimages2[2]=["../dynamicindex4/hh01478a.gif", "http://www.news.com", "_new"]

The body entries are:

<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, pause, optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 1, 3000, 1, "R")
</script>
<script type="text/javascript">
new fadeshow(fadeimages2, 110, 110, 0, 4000, 0)
</script>

I assume therefore that 'fadeimages' and 'fadeimages2' are the two slideshows. Am I therefore correct in using the following arrays in the header?

fadeimages[0]=["photo1.jpg", "photo2.jpg", "photo3.jpg"]
fadeimages2[0]=["photo1a.jpg", "photo2a.jpg", "photo3a.jpg"]

Or what's the significance of the [0], [1] and [2]?

I've tried the following:
1. Removing the script from my page to create a plain vanilla page, but I get the same problem.
2. Putting the slideshows separate, together, in on div and two separate divs, in table cells and straight on the page.
3. Putting a single image link in each of [0], [1] and [2] instead of three in the same bracket.
I'm not a programmer so I'm not sure of correct syntax.
The code itself remains untouched, yet unlike your own demo page it doesn't run. Could you please give an example of the arrays for a page with two slideshows, each with three images.
Am I right in guessing that the different slideshows would have to call different sets of images to avoid conflicts and delays?
Desperate for help!:confused:

jscheuer1
01-28-2006, 10:07 PM
I assume therefore that 'fadeimages' and 'fadeimages2' are the two slideshows. Am I therefore correct in using the following arrays in the header?

fadeimages[0]=["photo1.jpg", "photo2.jpg", "photo3.jpg"]
fadeimages2[0]=["photo1a.jpg", "photo2a.jpg", "photo3a.jpg"]

You assumed correctly but executed it wrong. The script requires at least empty fields for links and targets in each entry in each array. Your syntax has only one (three part) entry in each array and, without declaring the base arrays as arrays, probably will not have any entries in the base arrays. Use the syntax supplied on the demo page.