PDA

View Full Version : Passing Variables in HTML/Java for Dynamic Images


Revenant
09-15-2005, 02:59 AM
Hi.

I've currently got a page of small photo's in which visitors can click one to display a 'pop-up' style page of the photo clicked on. This second page displays the photo in full and I have some Javascript & input buttons so a user can click back & forward through all the photos that were originally displayed.

This can be seen here: http://www.simonwray.dsl.pipex.com/cressing_photo.htm (though note I am in the process of making my code more Firefox/W3 compliant, so it may not look pretty!).

This currently works by me having each main image on a page with the Javascript, buttons, etc, and the main page just links to each of these so when you click the small photo you display that full photo & the JS handles navigation (via an array) of each image in turn. (see http://www.simonwray.dsl.pipex.com/tech_photoviewer.htm for the code).

The problem is this means I have to maintain a page for each photo so I can provide a link to it.

What I'd rather have is the one photo page being passed a variable/parameter and have it start with this photo & then have the same navigation back & forward through the pictures.

I have a fairly standard ISP so I don't get .asp or .php, just scripting. Can anyone give me a way to do this?

Thanks
Simon

Terminator1138
09-15-2005, 06:06 AM
Would be hard since you do not get php or asp. I'm not sure if cgi will do it, but I'm thinking your ISP does not allow that either....perhaps another member might have an idea.

Kaabi
09-19-2006, 02:22 PM
I didn't even know there were variables in HTML...

Revenant
09-20-2006, 12:08 AM
I resolved this quite a while ago... but as you've recently done some thread-necromancy I thought I should post the solution.

I've got a detailed description of the how & why here:
http://www.simonwray.dsl.pipex.com/tech_photoviewer.htm

and an example of it in action is here:
http://www.simonwray.dsl.pipex.com/tunisia.htm

It's fairly invovled, but mainly because I wanted the user to be able to click any image in a thumbnail gallery and have that image as the first displayed in a new pop-up. The pop-up would then allow the user to browse forward or back from that initial image. The fact the initial image could be number 5 and not 1 and was in another window (i.e. the pop-up) added complications.

You can use a 'querystring' in the url to pass a parameter via html.

Tarmithius
09-20-2006, 05:28 AM
For a pop up gallery nicely done may I suggest a look at the new Lightbox JS (http://www.huddletogether.com/projects/lightbox/)