View Full Version : Preloaded Slideshow Script questions

07-25-2012, 05:10 AM
Found Jason Moon lovely pre-load script. Just the ticket.
I have two questions
1 - Can it be used with .jpg files or only .gif?
2- Can multiple shows be placed on a single page; or does each show need its own?

Moderator's Note:
In the future, please post about Dynamic Drive Scripts in the Dynamic Drive Scripts Help section here where I've moved this thread, and:

Warning: Please include a link to the DD script(s) in question in your post. See this post (http://www.dynamicdrive.com/forums/showpost.php?p=7) for more information.

07-25-2012, 06:47 AM
Found Jason Moon lovely pre-load script. Just the ticket.
I have two questions
1 - Can it be used with .jpg files or only .gif?
2- Can multiple shows be placed on a single page; or does each show need its own?
1. Yes it works with jpg's
2. It can be placed n any page

07-25-2012, 03:22 PM
Each show requires it's own page. You can use iframe to show another show from another page on the same page. Multiple shows can be displayed on a page that way.

There are other scripts that can put multiple shows on the same page:





07-25-2012, 04:19 PM
Many much thanks Bernie and John. Will heed correct posting protocol henceforth.
Script in question is -http://www.dynamicdrive.com/dynamicindex14/preloadslide.htm-
A lovely bit of code, simple, compact, clever. Kudos to JM

It'll probably be best to keep each show on a separate page, with an intermediate page containing links to each individual show.

I assume that the order in the Array is the order in which they play - important because the shows are "narrative" with screen shots and title cards.
Must go now - hip replacement surgery tomorrow in the early bright. Offline until at least Monday.
Many thanks again.

07-25-2012, 05:07 PM
Good luck with you're surgery!

I assume that the order in the Array is the order in which they play

That's right.

07-25-2012, 06:10 PM
Thanks. I have a great surgical team. Only wish I had something to contribute to this team (besides grist)

08-14-2012, 06:29 PM
Preloaded Slideshow Script (Jason Moon)
Surgery went very well. Recovery requires patience.
Finally got around to trying Pld SS Script. Seems to be a ghost in my machine.
I'm rather a Luddite. I Pastiche OP's code in Notepad. Add image names. Save as html. Open in OpenOffice w/html template for tweaking. Change image size, centering, fonts, add back and back to top links. Can edit html for short strokes. Worked very well for {div.../div} simple gallery I found elsewhere.
OpenOffice seems to have taken exception to this script, however. It kept changing the code placed in the body section.
<td colspan=2><img name="Screen" width=108 height=135></td>
into something that was calling image files from far away (. . ./. . ./. . .filename{some such}). It would then keep the coding it had introduced my best efforts notwithstanding.
I can fix anything with a hammer. Copied/Pasted code into new notepad. Verified head/body etc. syntax correct. Array items enclosed in single quotes - removed extraneous spaces I introduced when adding single quotes. Resized -name="Screen" width=108 height=135></td- as suggested. Resized images to fit into 523x384. Saved as .html in notepad.
Opened file in Firefox. Html in ViewSource looks correct. Buttons are present as is header text in regular view.
Empty frame on left side of screen. Buttons look buttony but do not bring new images.
Any thoughts on what to check for? Should array items be in quotes rather than apostrophes? If you want to examine code; how do I send it?

08-15-2012, 03:14 AM
Don't use Open Office for HTML.

08-15-2012, 02:45 PM
The four separate gallery pages I made using OO work just fine, and I intend to keep using them. It's a bumblebee.
Why does the script fail when OO not involved at all? Cobbled together, as per instructions, entirely in Notepad. I know I've done something dumb. Is this tag correct?

<BODY LANG="en-US" DIR="LTR" ONLOAD="StartSlideShow()">

Is there a limit to the number of slides? I've got about 55 in the array.

any other suggestions?

08-15-2012, 02:52 PM
No limit on slides. But the more you have, the greater the chance that you may have made a syntax error in the array of images. Also, it's possible that in at least some browsers, that if an image fails to load, that might break the script.

In any case, even if it works with that many images, it could take quite some time to preload them all.

It could be something else.

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.

None of the other slideshows I mentioned earlier would have all of these potential problems. Some would have some of them.

08-15-2012, 03:48 PM
Page not yet up. I tend to build and test before uploading. Will check for possible (likely) syntax error in array.
I had thought that the entire premise of this script was to load next image while the first was up, thereby avoiding the whole "pre-load all the images" delay.
Do you have a fave among:





I have four shows to create. Another as long as this one, and two more less than half this size (each on its own page called from main page.) Simpler is better. Right click or button to advance, left click or button to go back esc or button to return to main page.
Doesn't need fade/effects/ music.

08-15-2012, 04:05 PM
Just noticed broken link icon in empty frame. I must not have sufficient path info in the array. The page and the images will be in the same folder. Will I need to use a path that goes all the way back to the drive letter? I don't really understand the paths that look like
DriveLetter://. . ./. . ./. . ./foldername/subfoldername/filename (don't even think that's accurately reproduced e.g.)

08-15-2012, 05:57 PM
You just need a valid path to the image. For testing purposes though, you could just remove that image from the array.

Also, it's a good idea to make one folder for all of the images as a subfolder of the folder that has the slideshow on it. Move or copy them there. Then say that folder is called images. Then each path is the same:


Oh, and according to the script's description, it does an incremental preload. But that still may mean that a missing or broken image could break it when it gets to that point. Of the slideshows I mentioned before, Swiss Army is the only one that does a true incremental preload. Ultimate Fade-in and perhaps the others preload the first image and assume the other images will preload as they are a part of the DOM at that point. Almost always works out well for Ultimate Fade-in. I've less experience with the other two, but from what I've seen of them, whatever they do is good too, unless there are any really huge (in byte size) images.

Still, to be of any real help in diagnosing code, it's best to have a live demo of the problem to work with. So if you continue to have problems, put one up and post a link to it.

08-15-2012, 09:02 PM
Hi John,
Tried various path incarnations. While in same folder as show page tried foldername/imagename. NG. Added preceding / to foldername. NG
Moved images to subfolder of show page folder. Tried foldername/subfoldername/imagename. With and without preceding /. NG. Double checked for stray spaces etc between apostrophes in the array.

Put up here:
www.eli-tables.com/yahoo_site_admin/assets/images/BasicCAD Demo/BasicCAD Demo.html
Opens in Firefox. Sourceview looks like intended.

ne marche pas

Able to call individual slides as thus:
I think ultimately gonna make images display larger.
I'm sure I've done something lame that'll be obvious to your eye.

08-15-2012, 09:38 PM
There were 2 opening <script> tags, some misplaced and/or missing ' marks in the array, and the path should be:

Basiccad Pix/


/Basiccad Pix/

After I fixed those it ran for me:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.3 (Win32)">

//Preloaded slideshow script- By Jason Moon
//For this script and more
//Visit http://www.dynamicdrive.com

var Slides = new Array('Basiccad Pix/TITLE23.jpg','Basiccad Pix/DOCASE1.jpg','Basiccad Pix/DOCASE2.jpg','Basiccad Pix/DOCASE3.jpg','Basiccad Pix/DOCASE4.jpg','Basiccad Pix/DOCASE6.jpg','Basiccad Pix/DOCASE7.jpg','Basiccad Pix/DOCASE10.jpg','Basiccad Pix/DOCASE11.jpg','Basiccad Pix/DOCASE0.jpg','Basiccad Pix/INTTEXT1.jpg','Basiccad Pix/DOCASEX.jpg','Basiccad Pix/INTTEXT2.jpg','Basiccad Pix/BELLER6.jpg','Basiccad Pix/BELLER1.jpg','Basiccad Pix/BELLER2.jpg','Basiccad Pix/BELLER3.jpg','Basiccad Pix/BSCTXT1.jpg','Basiccad Pix/BSCSLD0.jpg','Basiccad Pix/BSCTXT2.jpg','Basiccad Pix/BSCSLD1.jpg','Basiccad Pix/BSCSLD3.jpg','Basiccad Pix/BSCSLD4.jpg','Basiccad Pix/BSCSLD5.jpg','Basiccad Pix/BSCSLD6.jpg','Basiccad Pix/BSCSLD7.jpg','Basiccad Pix/BSCSLD8.jpg','Basiccad Pix/BSCSLD9.jpg','Basiccad Pix/BSCTXT3.jpg','Basiccad Pix/BSCTXT4.jpg','Basiccad Pix/BSCSLD10.jpg','Basiccad Pix/BSCSLD12.jpg','Basiccad Pix/BSCSLD13.jpg','Basiccad Pix/BSCSLD14.jpg','Basiccad Pix/BSCSLD15.jpg','Basiccad Pix/BSCSLD16.jpg','Basiccad Pix/BSCSLD17.jpg','Basiccad Pix/BSCTXT5.jpg','Basiccad Pix/BSCSLD18.jpg','Basiccad Pix/BSCSLD19.jpg','Basiccad Pix/BSCTXT6.jpg','Basiccad Pix/D0.jpg','Basiccad Pix/D1.jpg','Basiccad Pix/D2.jpg','Basiccad Pix/D3.jpg','Basiccad Pix/D4.jpg','Basiccad Pix/D5.jpg','Basiccad Pix/D6.jpg','Basiccad Pix/D7.jpg','Basiccad Pix/D8.jpg','Basiccad Pix/D9.jpg','Basiccad Pix/BSCTXT7.jpg','Basiccad Pix/D10.jpg','Basiccad Pix/D11.jpg','Basiccad Pix/BSCTXT8.jpg','Basiccad Pix/DF.jpg');

function CacheImage(ImageSource) { // TURNS THE STRING INTO AN IMAGE OBJECT
var ImageObject = new Image();
ImageObject.src = ImageSource;
return ImageObject;

function ShowSlide(Direction) {
if (SlideReady) {
NextSlide = CurrentSlide + Direction;
document.SlideShow.Previous.disabled = (NextSlide == 0);
document.SlideShow.Next.disabled = (NextSlide ==
if ((NextSlide >= 0) && (NextSlide < Slides.length)) {
document.images['Screen'].src = Slides[NextSlide].src;
CurrentSlide = NextSlide++;
Message = 'Picture ' + (CurrentSlide+1) + ' of ' +
self.defaultStatus = Message;
if (Direction == 1) CacheNextSlide();
return true;

function Download() {
if (Slides[NextSlide].complete) {
SlideReady = true;
self.defaultStatus = Message;
else setTimeout("Download()", 100); // CHECKS DOWNLOAD STATUS EVERY 100 MS
return true;

function CacheNextSlide() {
if ((NextSlide < Slides.length) && (typeof Slides[NextSlide] ==
SlideReady = false;
self.defaultStatus = 'Downloading next picture...';
Slides[NextSlide] = CacheImage(Slides[NextSlide]);
return true;

function StartSlideShow() {
CurrentSlide = -1;
Slides[0] = CacheImage(Slides[0]);
SlideReady = true;
<BODY LANG="en-US" DIR="LTR" ONLOAD="StartSlideShow()">
<P ALIGN=CENTER><FONT FACE="Verdana, sans-serif"><FONT SIZE=6><I><B>BasicCAD
<form name="SlideShow">
<td colspan=2><img name="Screen" width=534 height=380></td>
<td><input type="button" name="Previous"
value=" << "
<td align="right"><input type="button" name="Next"
value=" >> " onClick="ShowSlide(1)"></td>
</HTML><!-- text below generated by server. PLEASE REMOVE --><!-- Counter/Statistics data collection code --><script language="JavaScript" src="http://l.yimg.com/d/lib/smb/js/hosting/cp/js_source/whv2_001.js"></script><script language="javascript">geovisit();</script><noscript><img src="http://visit.webhosting.yahoo.com/visit.gif?us1345065993" alt="setstats" border="0" width="1" height="1"></noscript>

Oh, and I was just double checking, there's one missing image:


I think that's just a typo, it's probably supposed to be BSCSLD10.jpg - I just fixed it in the above code.

08-16-2012, 03:58 AM
You are Da' Bomb!
It's Alive!
Now that you've set me on solid ground; lets see if I can make the remaining ones work.
Many much thanks