Click to See Complete Forum and Search --> : Image gallery WITH text


raf813083
07-27-2003, 10:05 AM
I found and adapted an image gallery script and posted it on the web. With the script itself, there is no problem. But the fact is that the pictures need some explanation, eg the name of the animal.

an example of the existing script:
http://user.deluxnetwork.com/~timmenten/egypte_fotos/rode_zee_1/

i have been looking for a way to make a little piece of text appear below or above the photo. Does anyone here have any idea how to do this? I really do hope so.:D


PS
below I'll post parts of the Scripts in a single ZIP-file

PPS
'index' is the framepage
'thumb' is (duh! :p ) the thumb page
'other' is the page where the full-sized pictures appear and hopefully soon also the texts

thanks in advance

Nevermore
07-27-2003, 01:39 PM
Just place them with HTML.

Khalid Ali
07-27-2003, 01:53 PM
Create an array of text values you want to print and make sure the text at ain index points to right image and then print the text from teh array when a particular image is displayed.

Exuro
07-27-2003, 08:53 PM
What I'd do if I were you is change your function loadPicture() so that it passes in a number instead of the name of the image file. So instead of having loadPicture('img1.gif') you'd have loadPicture(1). That's in the thumb.html file of course...

Next, in other.html, I'd have an array for with all the image file names in it, and another array with all your captions. You'd change your document.write()s accordingly. So the script would look something like this:


<script language="JavaScript"><!--
var imgs = new Array('img0.gif', 'img1.gif', 'img2.gif', 'ect.');
var captions = new Array('txt for img0', 'txt for img1', 'txt for img2', 'ect.');
if (location.search.length > 0) {
&nbsp;&nbsp;&nbsp;&nbsp;var num = location.search.substring(1);
&nbsp;&nbsp;&nbsp;&nbsp;document.write("<table height='100%' width='100%'>");
&nbsp;&nbsp;&nbsp;&nbsp;document.write("<tr><td align=center valign=middle>");
&nbsp;&nbsp;&nbsp;&nbsp;document.write("<img src='"+imgs[num]+"'><br>"+captions[num]);
&nbsp;&nbsp;&nbsp;&nbsp;document.write("<\/td><\/tr><\/table>");
}
//--></script>

raf813083
07-28-2003, 07:16 AM
Thanks a lot for the help.
After editing the code it worked like a charm.

Thanks again :D