• Notice regarding image hosts and attachments. See here.

Most simple HTML slideshow

Soldato
Joined
18 Oct 2002
Posts
10,512
Location
Behind you... Naked!
Im trying to get the most basic and simple slideshow I can.

I dont want any thrills, and I am trying to keep code to an absolute minimum.

<META HTTP-EQUIV="refresh" CONTENT="2;url=case1b.htm">

At the moment, I have it like this :-

HTML file, displays an IMG ( All images are same size ) for 2 seconds then it loads up a second page.

What I have done, is simply made multiple copies of the one HTML file, but each one loads up a different picture then refreshes to the next html file

Now, I deally I would like to have only the one htm file, that loads up the pictures from a given directory or list of pictures.

I have been given links to various sites for this or that slideshow source, and its been great and I have robbed code left and right and I have done some nic eand clean gallery slideshows with my own and stolen code, and guess what? All thats needed is one picture that changes into a second and then a third and then a fourth and so on and then goes back to the start, and one link, to return to the homepage... Nothign more!

What I have done, is exactly what is wanted, but of course, having each HTML file for each picture is a bit pooey I know you will agree.

Anyone care to offer some help?
 
Conrad11 :
Incapable of using PHP sorry.


Lightnix:
I will have a look at the code thanks... Looks acceptable, but Im not sure that I like the ONLOAD bit, but then it Im calling myself with the Metatags... It might work?
Im using a link in the page to go to the homepage, so, the BACK button ( If im loading myself a few times ) might not work? - Oh I dont know... I will have a play with the code later on ok?

Many thanks.


Blade007
Dynamic Drive? - yes, possibly... Didnt think of that.

Ok, thanks you lot... I will have a play and see if I can or cannot sort things out.
 
No, I mean, that ( Without looking at, and testing, the code ) that it at first, looks as if it loads in a picture for each time the page loads...

Now, if thats what it does, then sure, I am not after that.

However, if thats all it does, but then using a REFRESH in the META TAGS, brings up the next picture in a kind of Hack-way to do it, then thats great.

I dont know? - I have not tried it yet...


---


La la la...

Ah, right ok, thats simple enough...

Ok, this is EXACTLY what Im after... Absolutely spot on.

1 additions to the original question however...

1:-
Is there a limit on the array filename lengths?
The images are held in the images folder so they are being celled as "images/picy001.jpg" and so on...
Can I add an "images/" string and just have the images called as folderstring+"picy001.jpg"
If so, where can I use this?

2:-
Once it has displayed them all, it stops... How can I get it ro recycle through?

Im kind of going to just slap a HREF in the page to reload itself and this will work, but Id much prefer it to be not in there really.

Many many thanks.
 
Last edited:

Ok, looks straight forward. Thanks mate.

Actually I have never managed to get to grips with C / Java type languages... Won awards for Pascal programing in the 80's and in HBasic in the 90s but never could get into C and this looks the same to me.

So, when I say it looks straight forward, I mean that I can see where it needs to go, but other than that, it looks like garbage LOL



some people seem to think it's 2^53, others 2^26 bytes

Damn it! - Talk about limiting your work eh? :eek:


it's been on my mind all day...

What? If a question like that has been on your mind, then I am really really sorry for you. :D

Like this:

Code:
var folderstring = 'images/';
document.getElementById('imgid').src = folderstring+imgs[a];

Works fine for me.


Yes, thats exactly how I was thinking of doing it :rolleyes: Honestly guv!!

Ok, cheers for that... I will chuck these bits into the page later and see how it looks... Many thanks guys.

Oh, in the mean time, here is the bit Im talking about...

http://northwales-cases.co.uk/gal_a.htm

When I view with IE, the fade-ins etc are all lovely and smooth, but when browsing them they flicker, which is a bugger... Firefox is my preferred browser but it does not do the stupid eye candy stuff... Not that I care, but my brother seems to be going for the stupid eye candy over functionality.

Let me know what you think? - the site is as basic as I can get it.
 
Just update the function, when all of the images have been cycled, it will start again at the first one.

Hmm...

Somehow, no matter what I do, if I change the code to what you gaveme, I get script errors and the code wont work?

I cannot see how?
 
Java / Javascript. I have not looked at the code at all for any of them, so obviously I cannot comment on any. I am aware of programming techniques and how code works, or at least how code is supposed to work, I used to program myself, but some years ago, I lost a large portion of my brain when it spilled onto the road and I have lost the ability to learn bugger all these days, however, I have a few games released over the years, and some pro-audio apps are also or rather were also available, so I know the basics, but to be honest, more recent languages have simply gone over my head... Well, thats not strictly true.. The syntax has, but a lot of code, can be understood if you go through it slow enough... I just cannot write half the junk myself.

I got to grips with the very basics of C, but thats all. I much preferred pure assembly if I needed speed, but Pascal or even a good Basic was more than capable of anything I needed to do.

So, yes, I know what a recursive fuinction / subroutine is/does

Recusive Function causing a stack overflow?
Yes, I suppose it would, its clearly calling itself from inside itself - programming paradox!
 
Back
Top Bottom