Webwork
/
Random Images on Reload



To randomize the images either reload the page or click here.

Head:
<script language="javascript">
random.m=714025; random.a=4096; random.c=150889;
random.seed = (new Date()).getTime()%random.m;
function random()
{
random.seed = (random.seed*random.a + random.c) % random.m;
return random.seed / random.m;
}

function randomizeimages()
{
randomizeimage('image1', 6, '', '.jpg');
randomizeimage('image2', 6, '', '.jpg');
randomizeimage('image3', 6, '', '.jpg');
randomizeimage('image4', 6, '', '.jpg');
randomizeimage('image5', 6, '', '.jpg');
randomizeimage('image6', 6, '', '.jpg');
}

function randomizeimage(img, count, base, type)
{
document.images[img].src = base + Math.floor(random() * count + 1) + type
}
</script>

Body:
<body onload="randomizeimages()">

<img src="1.jpg" height="150" name="image1"> <img src="1.jpg" height="150" name="image2"> <img src="1.jpg" height="150" name="image3"> <img src="1.jpg" height="150" name="image4"> <img src="1.jpg" height="150" name="image5"> <img src="1.jpg" height="150" name="image6">

<p style="text-align: center">To randomize the images either reload the page or <a href="javascript:;" onClick="randomizeimages()">click here</a>.</p>
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