Re: Need help with random JPG display

by "Rossi Designs" <webmaster(at)rossidesigns.net>

 Date:  Tue, 2 May 2000 20:41:25 -0400
 To:  "Steven Stultz" <steven(at)sqsystems.com>,
"HWG HTML Techniques Listserv" <hwg-techniques(at)hwg.org>,
"HWG Graphics Listserv" <hwg-graphics(at)hwg.org>
 References:  sqsystems
  todo: View Thread, Original
This is a simple example

in the head ...
<script language="javascript">
myImages = Array("pic1.jpg","pic2.jpg",...,"lastpic.jpg");
rand = Math.floor(Math.random() * myImages.length);
</script>

Where you want the picture
<script language="javascript">
document.write("<img src=\"" + myImages[rand] + "\">");
</script>

and ... means you could have as many as you want in the array, don't put
that in your script.

Rossi Designs
PO Box 1084
Holly Hill, FL 32125-1084
Phone : (904) 226-8979
URL : http://rossidesigns.net
----- Original Message -----
From: Steven Stultz <steven(at)sqsystems.com>
To: HWG HTML Techniques Listserv <hwg-techniques(at)hwg.org>; HWG Graphics
Listserv <hwg-graphics(at)hwg.org>
Sent: Tuesday, May 02, 2000 7:26 PM
Subject: Need help with random JPG display


| I'm new to the list, so please be patient.
|
| I have need to incorporate into a web page the ability to display,
| within a cell of a table, a JPEG file at random from a pool of four or
| five.  In other words, I would like the page to display, at random, a
| different JPEG each time the page is loaded.  Coming from a programming
| background, mostly VB, I know that this should be possible (with
| JavaScript perhaps?) but am not sure how to go about attacking the
| issues.
|
| Suggestions?
|
|
| Thanks in advance.
|
|
|
| Steven Stultz
|
|
| --
| Steven Q. Stultz
| ------------------------------------------------->
|  SQ Systems
|  Computers, Web Design, Support, & Programming
|  Serving Central Ohio & Cyberspace since 1991
|  mailto:steven(at)sqsystems.com
|  <http://www.sqsystems.com>
|  Looking For <http://sqsystems.com/notice.htm> New Clients
|
|
|

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA