Tombo
11-16-2002, 07:15 PM
Okay, let me start from the top. :P
I'm making an online photo album with a bunch of my photos. It's composed of 3 frames. The far left frame has a list of albums. The far right frame will show thumbnails for whatever album is selected. The middle frame will shot the photo that is selected.
I'm trying to take the simplest approach. There's more than 500 photos total, so instead of creating a page for every photo and a page for every album, I'd rather use javascript to generate each page.
Each of my photo albums are organized by folders, and each folder contains all the photos, numbered 01, 02, 03, etc. (saved at jpg's) along with corresponding thumbnails in a folder called "t".
Here's what I wanted to do. On the album's page, each album's link would send information to a script: the directory the album refers to, and the number of photos the album has. Once a link is clicked, it will generate a page in the "thumbnails" frame, showing "x" number of thumbnails from the "y" directory, both variables sent to the function on the albums page.
Each line of script displaying each thumbnail in the "thumbnails" frame will be part of another script to have that thumbnail displayed in the center "photos" frame, centered both horizontally and vertically, on a black background. This script I have completed already, and here it is:
<script>
<!--
function showimage(imagesrc, imagedesc){
parent.photos.document.open()
parent.photos.document.write('<html><title>Online Photo Album</title><body bgcolor="#000000" topmargin="10" leftmargin="10" rightmargin="10" bottommargin="10" marginwidth="10" marginheight="10"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td valign="middle" align="center" width="100%" height="100%"><img src="'+imagesrc+'"></td></tr></table></body></html>')
parent.photos.document.close()
}
//-->
</script>
Here is how each line of script displaying a thumbnail will look:
<a href="" onClick="showimage('img/01.jpg');return false"><img src="img/t/01.jpg" width="80" height="60" border="5"></a><p>
I'm assuming I can use this same script, only modified, on the "albums" page to generate the page displaying the thumbnails.
I understand most of what I'm saying. :P I hope I made it somewhat clear. What I'm really looking for:
How would I write a loop where everytime it ran it would use document.write and insert a line displaying a thumbnail, using the loop's counter as the name of the image. (I might run into problems where the loop's counter is between 1-9 because the images are named 01 - 09.)
I hope that made some sense. :P
I'm making an online photo album with a bunch of my photos. It's composed of 3 frames. The far left frame has a list of albums. The far right frame will show thumbnails for whatever album is selected. The middle frame will shot the photo that is selected.
I'm trying to take the simplest approach. There's more than 500 photos total, so instead of creating a page for every photo and a page for every album, I'd rather use javascript to generate each page.
Each of my photo albums are organized by folders, and each folder contains all the photos, numbered 01, 02, 03, etc. (saved at jpg's) along with corresponding thumbnails in a folder called "t".
Here's what I wanted to do. On the album's page, each album's link would send information to a script: the directory the album refers to, and the number of photos the album has. Once a link is clicked, it will generate a page in the "thumbnails" frame, showing "x" number of thumbnails from the "y" directory, both variables sent to the function on the albums page.
Each line of script displaying each thumbnail in the "thumbnails" frame will be part of another script to have that thumbnail displayed in the center "photos" frame, centered both horizontally and vertically, on a black background. This script I have completed already, and here it is:
<script>
<!--
function showimage(imagesrc, imagedesc){
parent.photos.document.open()
parent.photos.document.write('<html><title>Online Photo Album</title><body bgcolor="#000000" topmargin="10" leftmargin="10" rightmargin="10" bottommargin="10" marginwidth="10" marginheight="10"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td valign="middle" align="center" width="100%" height="100%"><img src="'+imagesrc+'"></td></tr></table></body></html>')
parent.photos.document.close()
}
//-->
</script>
Here is how each line of script displaying a thumbnail will look:
<a href="" onClick="showimage('img/01.jpg');return false"><img src="img/t/01.jpg" width="80" height="60" border="5"></a><p>
I'm assuming I can use this same script, only modified, on the "albums" page to generate the page displaying the thumbnails.
I understand most of what I'm saying. :P I hope I made it somewhat clear. What I'm really looking for:
How would I write a loop where everytime it ran it would use document.write and insert a line displaying a thumbnail, using the loop's counter as the name of the image. (I might run into problems where the loop's counter is between 1-9 because the images are named 01 - 09.)
I hope that made some sense. :P