A LIST Apart: For People Who Make Websites

No. 160

Discuss: Random Image Rotation

Pages

 1 2 3 >  Last »

1 ASP

Nice article :)

If anyone is interested in an ASP version:

Demo : http://www.duelcom.com/malani/db/img/

http://www.duelcom.com/malani/files/otherstuff.zip (ImageTools – also includes an album page)

posted at 06:49 pm on October 21, 2003 by Abhi Malani

2 Nice Nice Nice

excellent code and article,

thank you guys!

posted at 09:17 pm on October 21, 2003 by mac davis

3 Watch out for the ASP version above

Does not work in Safari. I didn’t test it with any other browsers.

Spits out:

GIF89ad

posted at 12:23 am on October 22, 2003 by Charles S.

4 Ooops, modifying my previous comment

Along with “GIF89ad” it also spits out a bunch of unlegible characters.

Apparently the forum doesn’t allow such characters…

posted at 12:25 am on October 22, 2003 by Charles S.

5 Brilliant

Nice and clean.
Will be featured at www.phnk.com in a few days. Credits go to author on index page, for sure.

posted at 02:00 am on October 22, 2003 by François Briatte

6 More on the ASP version above

Firebird doesn’t like it either. Looks like an IE-only script. Shame – I can’t use PHP for professional projects and I can’t pull this kind of thing off in ASP myself… Still, a good little article. I already use Dan’s code on my personal site to display random CSS background images. Works beautifully.

posted at 02:01 am on October 22, 2003 by LintHuman

7 Using the randomizer in CSS

Just thought I’d better explain how you can use Dan’s script for CSS background-images.

In your CSS file, simply put the location of the script in the url() value of the background-image property:

div#rotateImage {
background-image : url(/scripts/rotate.php);
}

and you’re laughing!

posted at 02:12 am on October 22, 2003 by LintHuman

8 ASP version

^^^ Apologies.

Apparently it doesn’t work as the link I gave is for the actual script itself. The script works well otherwise.

http://www.duelcom.com/malani/db/img/imgrotate.asp

This is an HTML page with the image script linked.

tested in IE/Moz/FB/NN.

posted at 03:13 am on October 22, 2003 by Abhi Malani

9 Another option...

Possibly even easier, this script you don’t have to actually edit. Simply drop this script into the same directory as the images are that you want to change between.

Example:
http://www.devnetwork.net/forums/images/faces/randimages.php

Code:
http://www.devnetwork.net/forums/images/faces/randimages.phps

posted at 05:32 am on October 22, 2003 by Jason Lotito

10 Possible extensions...

This may be beyond the scope of the article, but it would be very cool to have a rotation script that could handle dimensions (for faster layout) and captions/alt text/longdesc (for accessibility) as well.
There are certainly (nonsemantic) images for which the proper alt text is empty—and for that matter sets of images for which the alt text is always the same, but both additional features would have important benefits for certain groups (of images, and of visitors). I can think of a few ways to handle this—from<ul><li>putting the images, dimensions, alt text, longdesc, and caption info in a database,</li><li>to using a more heterogenous folder with images, text files, and so on, and a common naming scheme (image-j.png, caption-j.txt, longdesc-j.txt, dimensions-j.txt…)</li><li>to embedding the alt, caption, and longdesc info in the IPTC headers and then using one of the open source IPTC parsers to extract them</li></ul>All of those have potential downsides in terms of workflow, but they would also have significant potential benefits as well.
…Can you tell that I’m working on these issues for another project right now?

posted at 05:48 am on October 22, 2003 by Stephen Sample

Pages

 1 2 3 >  Last »

Discussion Closed

New comments are not being accepted, but you are welcome to explore what people said before we closed the door.

Got something to say?

Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.

Create a new account or sign in below if you’d like to leave a comment.

Remember me

Forgot your password?

Subscribe to this article's comments: RSS (what’s this?)