-
equivalent to a loop
I like to know how to spread 100 images in rows and columns on a web page running against a directory. These images will be in thumb nail size.
Is javascript the answer here? My js is a bit weak. Can you give me a sample to work off?
I know how to do this in visual basic. I would use Do Loop with the Dir command.
Thanks
-
Do you mean you want to do the following:
1) look at a directory on your server
2) count all the images in that directory
3) display all the images in that directory as thumbnails
-
Either Server or local hard drive. I don't have a server.
Yes, to the rest.
-
You'll need Perl, PHP, ASP(VBSCRIPT) or another Server Side Language, to do this as Javascript Can't access the file system!
Seeing as you know how to do it using VB, then ASP is probbably your best solution, but that all depends on what you host allows you to use!
If you want to use JavaScript, you will have to hard code (manually) the images perhaps into an array eg
Code:
var my_images = new Array();
my_images[0] = "/images/image.gif";
my_images[1] = "/images/image1.gif";
my_images[2] = "/images/image2.gif";
for (i = 0; i < my_images.length; i++){
document.write('<img src="' + my_images[i] +'">');
}
If you have a lot of images and don't want to use a server side language/technnology, you could always write a small VB App that creates the my_images array then copy and paste that into your webpage!
:cool:
-
I wouldn't store them in an array, but yes, this is something you will need to do with a server-side technology. ASP works plenty well, and I have nothing against the FSO.
-
how would you store them then ??
-
I wouldn't. They are already stored by the FS, I don't need to do that again. The FSO has a method that will return a file name in a given folder. You can ask again, and it will return the next file in the folder.
Regretably, the documentation at MSDN not only sucks, but continues to change location and text. It is a calibur of mental disfunction that I can't begin to fathom.
'Course, if you don't want to use VBScript to do this, you could make a PerlScript ASP. This is a fair sight easier, but the documentation is several orders of magnitude better.
-
can you give me an idea of what asp looks like? I am doing aspx now and have never touched asp.
Here is something I found for thumbnail. Is this a good method? If it is a good method, please explain whats he mean in plain english.
http://www.btinternet.com/~truesilen...ages/popup.htm