/    Sign up×
Community /Pin to ProfileBookmark

random images per page load

I am trying to have one large image randomly change each time the page reloads. Trying to figure it out from other peoples posts and replies but I just can’t seem to understand.

This is the site I just started and the script I copy and pasted from someone elses posting. My question is how or where do I specify my own images into it? Thankyou so much

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd“>
<!– saved from url=(0014)about:internet –>
<html>
<head>
<script language=”JavaScript”>
<!– Hide from old browsers

var imagenumber = 3 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = “images/top_image_01.jpg”
images[2] = “images/top_image_02.jpg”
images[3] = “images/top_image_03.jpg”

var image = images[rand1]
// — End Hiding Here –>
</script>

<title>Greg Gordon Photography, Duncan BC</title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>

<link href=”boots.css” rel=”stylesheet” type=”text/css”>
</head>

<body>

<div id=”navigation”>

<h2>The Main navigation</h2>
<ul>
<li><a href=”#”>Page One</a></li>
<li><a href=”#”>Page Two</a></li>
</ul>

</div>
<div id=”header”>
<h1>Greg Gordon Photography</h1>

<p> You are at the home of Greg Gordon Photography. This site is dedicated to many. Family and friends who have been fans of Greg&amp;s work for decades. Please enjoy some of his work here and feel free to contact him with questions or comments. </p>
</div>

<div id=”centerDoc”>
<h2>Enjoy the images</h2>

<img name=”myimg1″ src=””>
<img name=”myimg1″ src=””>

</div>

</body>
</html>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoMay 06.2007 — Change the image names in the images array:

images = new Array
images[1] = "images/top_image_01.jpg"
images[2] = "images/top_image_02.jpg"
images[3] = "images/top_image_03.jpg"
Copy linkTweet thisAlerts:
@catfishauthorMay 06.2007 — I uploaded in case it would make the difference. It did not. The link is, http://www3.telus.net/public/catfish/index.html Will you please look at the code there again?

Thankyou so much.
×

Success!

Help @catfish spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...