PDA

View Full Version : Ultimate Fade-in slideshow (v2.4) HELP imagearray error line 38 of fadeslideshow.js



mushmush
08-18-2010, 04:01 AM
1) Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: I have been using this script for my slide show for at least a week now and it has been working great up until now. I added more images which I have done previously with no problems, now in Firefox I am getting an error that says (in firebug)

setting.imagearray[i] is undefined
[Break on this error] preloadimages[i].src=setting.imagearray[i][0]

says it is a problem in line 38 or fadeslideshow.js which I never edited.

PLEASE PLEASE SOMEONE HELP.

the url is www.civilianaire.com

jscheuer1
08-18-2010, 05:15 AM
Extra comma (red) at the end of the highlighted line:


var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [750, 400], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/civilianaire.1.png", "", "", ""],
["images/civilianaire.21.png", "", "", ""],
["images/civilianaire.25.png", "", "", ""],
["images/civilianaire.26.png", "", "", ""],
["images/civilianaire.22.png", "", "", ""],
["images/civilianaire2.png", "", "", ""],
["images/civilianaire.5.png", "", "", ""],
["images/civilianaire.18.png", "", "", ""],
["images/civilianaire.27.png", "", "", ""],,
["images/civilianaire.28.png", "", "", ""],
["images/civilianaire.23.png", "", "", ""],
["images/civilianaire.16.png", "", "", ""],
["images/civilianaire.4.png", "", "", ""],
["images/civilianaire.9.png", "", "", ""],
["images/civilianaire.14.png", "", "", ""],
["images/civilianaire.24.png", "", "", ""],
["images/civilianaire.6.png", "", "", ""],
["images/civilianaire.7.png", "", "", ""],
["images/civilianaire.10.png", "", "", ""],
["images/civilianaire.17.png", "", "", ""],
["images/civilianaire.11.png", "", "", ""],
["images/civilianaire.12.png", "", "", ""],
["images/civilianaire3.png"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

Notes: The 'error' reported isn't always where the 'error' is. In this case it's reported where processing the array causes a problem. The array itself is valid, it just happens to contain an unexpected empty entry created by this extra comma.

mushmush
08-18-2010, 05:27 AM
Thank you so much! You're my hero!

mushmush
08-18-2010, 03:47 PM
Ok so I swear this worked great on all platforms before. But, now it sort of doesnt seem to work in safari or IE Any ideas. Was working great before the comma ordeal.

Also, is it possible to have too many images in this slide show?

jscheuer1
08-18-2010, 04:09 PM
It is possible, but you're nowhere near that yet. The problem is that:

http://www.civilianaire.com/images/civilianaire.1.png

(civilianaire.1.png) is a 404 not found. IE will not initialize if the first image is missing, possibly not work correctly if any image is missing. But this is the first image, so it won't initialize.

I see you have a civilianaire1.png in that location, so change this code:


<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [750, 400], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/civilianaire.1.png", "", "", ""],
["images/civilianaire.8.png", "", "", ""],
["images/civilianair

to:


<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [750, 400], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/civilianaire1.png", "", "", ""],
["images/civilianaire.8.png", "", "", ""],
["images/civilianair

Or get rid of the highlighted line entirely.

I'm not sure if that will fix it in Safari, it may. If not, take care of this anyway, and I'll have another look.

mushmush
08-18-2010, 05:31 PM
Thanks again!

jscheuer1
08-18-2010, 05:59 PM
Great! I meant to add though - about too many images - that there is another consideration that goes along with that. It's the byte load of the images. Images for the web should be optimized. I see all of yours are PNG format. Most if not all would be acceptable in JPEG (.jpg) format and could be compressed a lot more that way. Just be careful not to compress them too much so as to lose too much resolution. Keep your PNG ones as backups in case you overdo it with the compression on the JPEG ones.

Think of it this way - having all those images in the show is nearly the same as having them all right on the page. They will preload incrementally. That's the only advantage. But they still have to load. On slower connections larger (byte size) images take longer to download, so could make the show balky or otherwise odd looking at first until all the images have loaded.

cmaynordesigns247
11-04-2010, 04:34 PM
<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [735, 459], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/cost_savings.jpg", "QUICK/", "", ""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/efficiency.jpg", "QUICK/", "", ""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/modularity_home.jpg","QUICK/","",""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/environment.jpg","environment/","",""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/transparency.jpg", "QUICK/", "", ""]

],
displaymode: {type:'auto', pause:3500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})




</script>

this works fine in everything but IE..http://hpquickpage.com.au

ddadmin
11-04-2010, 05:49 PM
cmaynor, remove the trailing comma (,) following the last image array element (in red):


imagearray: [
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/cost_savings.jpg", "QUICK/", "", ""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/efficiency.jpg", "QUICK/", "", ""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/modularity_home.jpg","QUICK/","",""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/environment.jpg","environment/","",""],
["http://hpquickpagecom.web4.hubspot.com/Portals/46493/images/transparency.jpg", "QUICK/", "", ""],

],

IE is picky about this sort of things.

cmaynordesigns247
11-04-2010, 06:06 PM
thanks
I did see that above. I downloaded page and removed the comma for test on local and still not there in IE but fine in explorer see the code I pasted the comma is removed.

jscheuer1
11-04-2010, 06:19 PM
There's no way we can diagnose with certainty anything on your local computer. IE can cache even local pages though, perhaps that's the problem. Try refreshing the page.

Upload the fixed version, the one without the extra comma, to the location you gave us, so we can check it out.