Results 1 to 8 of 8

Thread: equivalent to a loop

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    Forest
    Posts
    545

    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
    Bird of Prey

    Mr. Bald Eagle.
    [img][/img]

  2. #2
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    Forest
    Posts
    545
    Either Server or local hard drive. I don't have a server.
    Yes, to the rest.
    Bird of Prey

    Mr. Bald Eagle.
    [img][/img]

  4. #4
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    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!

  5. #5
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  6. #6
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    how would you store them then ??

  7. #7
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    Forest
    Posts
    545
    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
    Bird of Prey

    Mr. Bald Eagle.
    [img][/img]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width