View Full Version : Swiss Army Image Slideshow

11-02-2007, 10:23 AM
Thank you for a great script. I have two question:

1. Is it possible to edit the text for the image counter?
Now it says "Viewing image: 1 of 4". I would like it to display just 1 : 4

2. I'm stuck here, why does this happend? In IE 7 I miss space after 1: 4 when I run the script locally (http://home.no.net/pixelmix/test01.gif/). When I run the script online (http://home.no.net/pixelmix/test02.gif/), it works just fine. Why?

Hope you can give me an answer for this.


11-02-2007, 01:07 PM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

Find this function in the script:

document.write('<div align="center">Viewing Image: <b><span id="thecnt'+this.issid+'"><\/span><\/b> of<span style="font-size:1ex;">&nbsp;</span>&nbsp;<b>'+this.imgs.length+'<\/b><\/div>');

You can plainly see where the:

Viewing Image: 1 of 4

is coming from. Using a plain text editor, you can change those words to whatever you prefer.

As far as your second question goes, I cannot be sure. As long as it looks OK online, why worry? However, if after making your page live, there is still a problem, perhaps you need to use a valid URL DOCTYPE like:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

with your page. If you need more help:

Please post a link to the page on your site that contains the problematic code so we can check it out.

11-02-2007, 08:20 PM
Script: Swiss Army Image Slideshow

Like this I hope. Thank you for making me aware of this. Sorry.

First of all, thank you for a quick response.
Yes, I found the line of code for editing.
I still have this "bug" for lack of space after the first number.
You can see it live here (http://www.meisel.no/swiss/index.html).


11-02-2007, 09:07 PM
OK, you have an older, developer copy of the main script:

<script src="sai_ss.js" type="text/javascript"></script>

Use the release version from the demo page instead. It is called swissarmy.js and may be copied/saved from this link:


or from the demo page.

11-03-2007, 06:46 PM
Ok! I have copied the right code, both html and the .js file, but it didn't do much of a difference. Updated link (http://www.meisel.no/swiss/index.html) to the site.

The problem for me is only in IE 7. The strange part here is that the posted script workes fine in IE 7. I don't understand what is wrong here.
Any ideas what causes this? I think it's really weird.


11-03-2007, 08:21 PM
There is something going on with your server. The only difference I can find so far in the way these two files are being served is in their byte size. The one on your server reports as:

18051 bytes

The one on Dynamic Drive's server reports as:

17630 bytes

However, if I navigate directly to them and copy them to a text editor and compare them, they are reported as identical.

Ah, I just tried comparing their generated source from the two servers. These vary and at the exact line where this is happening. If you change:

<\/span><\/b> of<span style="fon


<\/span><\/b>&nbsp;of<span style="fon

it should take care of it. I have no idea why your server is doing that, and it should actually result in a smaller served size from your server, not a larger one, but hey, let's see what happens. Even just according to the rules of HTML, using the non-breaking space entity there should be more certain of guaranteeing that the space is rendered.

11-04-2007, 09:05 PM
I'm going to call my webhost tomorrow and ask them why this is.
Anyway, our tip took care of the problem, have a look (http://www.meisel.no/swiss/index.html).

I'm not a tech guy. You are! Thanks John for all your help.


11-04-2007, 09:25 PM
I wouldn't be too hard on your host, the script should be updated, as having the entity there won't hurt anything, and if it helps in the odd situation like you have just experienced, why not? The only problem is, though it is my code, I don't have the access to make even such a simple update on the DD server. While at the same time, the one person who does shouldn't really be bothered with such a minor change. That (access for me) may be coming though.

Alternatively, I have plans for that script. I would like to rewrite it, adding in more style hooks and optional properties to make customization by intermediate and advanced designers easier, and to just generally tighten up the code. Once I do that, it will be worth bothering DD about updating it. I just hope I remember this issue when that time comes.