Look into the randomize() and randrange() functions to get the number...
As long as the images are in their own directories, you can use the
<CFDIRECTORY> tag to get the file, generate a random number and access the
directory list as an array.
.... then again, some hosts disable the CFDirectory. If that's the case, you
can still generate the random number and use it in your img tag.
The difference between the two? With the <cfdirectory> option you don't
restrict yourself to naming the files 1.jpg through 100.jpg. You can have
100 images in the directory with 100 different names, it just grabs the
filename and uses it.
HTH
Hatton Humphrey
-----Original Message-----
From: Carlo van Wyk [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 04, 2001 1:13 PM
To: CF-Talk
Subject: Random images from directory
I need to display random images from a directory. (Almost like a Ad
rotator.) There will probably be about 100 .jpeg files in the directory ata
a time, and they will be in the format 1.jpg to 100.jpg
How can one display the images randomly?
Regards
Carlo
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists