Webwork
/
Random Image with Link and Caption

This JavaScript randomizes the image along with its caption and URL. It will work with as few as two image and as many as you feel like adding.

It is a very useful way to keep a Web site home page looking fresh for return visitors.

Web page:
Source:
<script language="JavaScript">

images = new Array(5);

images[0] = "<a style='font: bold 10px/28px verdana, sans-serif; color: #666; letter-spacing: 3px; text-decoration: none; ' href = 'http://www.re-vision.com/photography/rome2006/index.html'><img src='images/0.jpg' alt='Photographs of Rome and Florence' border='0'><br />Photographs of Rome and Florence »</a>";

images[1] = "<a style='font: bold 10px/28px verdana, sans-serif; color: #666; letter-spacing: 3px; text-decoration: none; ' href = 'http://www.re-vision.com/photography/barcelona/barcelona-cover.html'><img src='images/1.jpg' alt='Photographs of Barcelona, Catalonia' border='0'><br />Photographs of Barcelona, Catalonia »</a>";

images[2] = "<a style='font: bold 10px/28px verdana, sans-serif; color: #666; letter-spacing: 3px; text-decoration: none; ' href = 'http://www.re-vision.com/photography/providence1976/'><img src='images/2.jpg' alt='Photographs of Providence, Rhode Island' border='0'><br />Photographs of Providence, Rhode Island »</a>";

images[3] = "<a style='font: bold 10px/28px verdana, sans-serif; color: #666; letter-spacing: 3px; text-decoration: none; ' href = 'http://www.re-vision.com/photography/reliance/'><img src='images/3.jpg' alt='Photographs of The Reliance Building' border='0'><br />Photographs of The Reliance Building »</a>";

images[4] = "<a style='font: bold 10px/28px verdana, sans-serif; color: #666; letter-spacing: 3px; text-decoration: none; ' href = 'http://www.re-vision.com/photography/santafe/'><img src='images/4.jpg' alt='Photographs of Santa Fe, New Mexico' border='0'><br />Photographs of Santa Fe, New Mexico »</a>";

index = Math.floor(Math.random() * images.length);
document.write(images[index]);

</script>
Previous | Webwork Table of Contents | Next >
Re-Vision.com

projects:
Simple Truths (and Complex Lies)

The Built World
Semblance Portrait Project
Back to Square One
Changing Chicago
Chicago's Reliance Building
US
Along the Mississippi River
The Work of Antoni Gaudí
Graffiti

places:
Morocco 2023
Beecher, Illinois
Iceland 2017
Cuba 2015
Providence, Rhode Island
Greece 2013
Eastern Europe 2013
Israel 2010
Paris, France
Puebla, Mexico 2009
Puerto Rico 2009
Barcelona 2007
Rome, Italy 2006

archive:
Graphics, sounds, and other ancient
items from the dawn of the Web.


FWIW:
Biography

©
Jay Boersma