Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    displaying random images from a folder

    Hi,

    Does anyone know of any scripts which will let you display a random image taken from a folder full of images?

    All I can find at the moment are scripts which let you specify random images to display.

    What I really want is the ability for a script to just wander through a folder full of stuff displaying whatever jpgs, gifs etc that it finds in a random order.

    Thanks.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think you could do that using VBScript.....look for it in VBScript resources. If you want to use a JavaScript, you could place all the images in an array and display one out of them randomly.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As premshree aluded, you can only really accomplish that by using
    a server side language. Reasonably easy in PHP , I'm sure ASP
    could do it, as could perl and vb.

    In javascript you'd need to either hold all the image names in an
    array or use a rigid numeric numbering system for them.
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #4
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks all

    Thanks for that. I suspected that it was not going to be simple. I don't have any server side scripting facilities, so it's back to the javascript array solution that I'm using.

    Thanks though.


  •  

    Posting Permissions

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