View Full Version : Slide show

09-26-2003, 03:34 PM
Hi everybody,

I checked the scripts enumerated in this wite and I am at a loss. I have difficulty selecting the appropriate script.

I need a simple slide-show script that will work on PC & Mac, with most of the browsers. The one I am using now is OK on PC but not on a Mac.
I should be able to show a picture, and 4-5 lines for the credits, plus forward-backward buttons.

Please, if anybody can direct me toward this target

Thanking you in advance

PS I just love the one I am using now, any chance that it can be modified to accomodate Mac users?

09-26-2003, 04:07 PM
Slideshows? I've got about a million of them. Take your pick, there's at least one in there that closely matches your discription, it's called "Complex Slideshow.html" I think.

09-26-2003, 04:23 PM
Thank you so much!!

Yes, I like the complex slideshow. I would like though to include the credits, say 5 lines of short text just next to the image.
The final output should look like a table with 2 adjacent cells, one containg the picture and one containing the text.
How will I do that, again it should work on a Mac?
(I use a PC, I do not have access to a Mac)

09-26-2003, 06:12 PM
Ignore this.

09-26-2003, 06:13 PM
I personally try to never use tables as CSS has moved in to replace most/all formatting of content that HTML used to do.

However since you asked for an example with tables, I have provided one. Just include \n in the text for the image to create a new line.

09-26-2003, 07:27 PM
Yes, that's it!!!
Thank you so much, I can use this to eliminate my Mac problems.

Just for the record, if you have a few minutes, can you please just take a look at this address: http://pages.infinit.net/zeus/gallery/
This is the script that I am using presently, which is fine for Windows
But why this script does not work with Mac, what is the problem with it? What is the culprit?

09-26-2003, 07:57 PM
It's hard to say what's preventing it from working because I don't have a mac.

I can suggest things that may cause problems, however it does depend what Internet browser you are using, it may not work if you are using an older browser.

These could be the troublesome areas:

You have not declared your variables.

You have not declared your arrays (more serious).



should be:

else if(direction=="prev")

and if it were me I would reduce it to this:


although it wouldn't much difference.

Another point, there is an if statement encompassing the entire contents of the function:

function chgSlide(direction) {
if (document.images) {



It could be that in your mac browser comes up false for document.images and so the contents in the if are not run.

Final point, I found this:


It could be that your mac browser doesn't support innerHTML, but this would only affect the credits.

Failing that I don't know what could be causing the problem, especially as I don't have a mac to test on and since there isn't much more script that could go wrong.

I have uploaded a modified version of your script, it does the same job as your original script and has all the same variable names but it is slightly modified and so should work for more browsers:

09-26-2003, 10:45 PM
Thanks a million!!!
I sure appreciate your input, I will have to be more careful.

Since I am on a roll, learning....
one final question..

You said that you avoid usually tables, prefering to use CSS...

Supposing that you wanted to center a picture and/or a text vertically AND horizontally, in the exact center of the screen, whatever the resolution whatever the size of the screen, how would you do that with CSS? I usually do it with javascript, is there a simpler way?

09-26-2003, 11:00 PM
I don't use tables for layout because the W3C (http://www.w3.org/TR/WAI-WEBCONTENT/#context-and-orientation) say that you shouldn't. I'm a good little coder and always do what they tell me.

I realise that CSS can't completely replace tables but it can do many more things than them as well. I think that if you wanted to put something in the centre of the screen you could do this:

<div style="width:100px;height:100px;position:absolute;top:50%;left:50%;margin:-50px 0 0 -50px;vertical-align:middle;text-align:center;">Hello</div>

That should centre the div and also the content inside the div.

09-26-2003, 11:04 PM
Been discussed here before:

09-26-2003, 11:09 PM
Thank you both Lavalamp and Liorean.

I sure appreciate the input and the resources. I have learned a few new things today.


09-26-2003, 11:20 PM
Happy to help. :)

09-27-2003, 01:18 AM
Originally posted by hrisula
I have learned a few new things today.
Well, they say life is a learning experience, and a day where you have learned something is a day that's not gone to waste. (Can't think of any more proverbials about learning at the moment...)

Always happy to help!