Results 1 to 2 of 2

Thread: Ultimate Fade-in slideshow 2.0 - substitute imagearray for another array variable

  1. #1
    Join Date
    Jan 2014
    Wentzville, MO
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow 2.0 - substitute imagearray for another array variable

    I am using Ultimate Fade-in Slideshow v 2.0 and need to substitute my own image array but have not found the correct syntax to make it work.
    I have a directory of images that I'm reading with PHP and then splitting those images into two arrays (for the Left side and the Right side because I have two slideshows on the same page).
    The code below is only for the left slideshow; I know how to make the other one separate.
    I have not included the PHP code for getting the filenames ($banner) because it already works. I have included the creation of the JS array in case anyone else would like to use this code.
    However, my problem is simply using my JS array as a variable for the imagearray. I have tried all kinds of syntax, to no avail.

    I currently have a document.write turned on to show the results of the array variable I want to use and the test page is [noparsel][/noparse].
    The variable array is this:
    ["images/banner/!headerLeft.jpg", "", "", ""],["images/banner/1.jpg", "", "", ""],["images/banner/11.jpg", "", "", ""],["images/banner/13.jpg", "", "", ""],["images/banner/15.jpg", "", "", ""],["images/banner/3.jpg", "", "", ""],["images/banner/5.jpg", "", "", ""],["images/banner/7.jpg", "", "", ""],["images/banner/9.jpg", "", "", ""]
    <script language="JavaScript" type="text/JavaScript">
    	// Find out how many photos are in the array
    	var BannerCount = <?php echo count($banner); ?>;
    	// Put PHP array into a Javascript Array
    	var aBanner= new Array(BannerCount); 
    	for($i=0; $i < count($banner); $i++){				
    		$MyJava = "aBanner[".$i."] = '" . $banner[$i] . "';";						// develop the JS
    		echo $MyJava;																// write the JS to browser
    	var imagearrayL = new Array();							// Set up array needed for slideshow
    	var imagearrayR = new Array();							// Set up array needed for slideshow
    	// Add each photo to one of the arrays
    	for(i=0; i<=BannerCount-1; i++)							// For each record in banner array
    		var $BannerPic = '["images/banner/' + aBanner[i] + '"]';	// put banner pic into JS variable
    		if(i % 2 == 0) {											//If pic number is even (modulus remainder 0)
    			imagearrayL.push($BannerPic);							// put it in the Left Array
    		else {														//If pic number is odd, put it in the Right Array
    			imagearrayR.push($BannerPic);							// put it in the Left Array		
    	var mygallery=new fadeSlideShow({
    	wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    	dimensions: [266, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
    	imagearray: imagearrayL,   // THIS IS THE LINE THAT IS NOT WORKING ***************************************
    	displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
    	persist: false, //remember last viewed slide and recall within same session?
    	fadeduration: 600, //transition duration (milliseconds)
    	descreveal: "ondemand",
    	togglerid: ""
    alert ('Javascript is finished and was not broken.');

  2. #2
    Join Date
    Mar 2005
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries


    Use the Chrome browser. In it view the problem page. Press Ctrl - U to see how the page is being served. Press F12 to open developer tools and hit the console tab to see any errors that are being reported.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Replies: 3
    Last Post: 08-14-2013, 03:36 PM
  2. Replies: 10
    Last Post: 11-04-2010, 06:19 PM
  3. Ultimate Fade-In Slideshow (v1.5): automating image array
    By vrm in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 02-16-2010, 04:39 AM
  4. ultimate fade-in imagearray passing
    By Ike in forum Dynamic Drive scripts help
    Replies: 9
    Last Post: 11-18-2009, 03:47 PM
  5. Ultimate Fade-in Slideshow link to specific image in array
    By fausty in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 07-16-2009, 06:39 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts