You can also do image randomizing client-side. Just add a few lines of
javascript to generate the image name to load.

In the example below, you would name your images rotate_1.gif, rotate_2.gif,
etc. in the images subdirectory. They should be all the same size.

In the HEAD section of your page:

<SCRIPT LANGUAGE="Javascript">
// Rotate pictures
var PixCount = 20; // No. of pictures

var PixIdx = Math.ceil(PixCount * Math.random());
PixIdx = "" + PixIdx;
LoadedPix = new Image();
LoadedPix.src = "images/rotate_" + PixIdx + ".gif";

function LoadPix() {
  document.images['LoadedPix'].src = LoadedPix.src;
}
</SCRIPT>

Where you want the images to appear, initially load a transparent pixel:
<IMG NAME="LoadedPix" SRC="images/clearpixel.gif" WIDTH=240 HEIGHT=60>

Add to the BODY tag: onLoad="LoadPix()"

With a little modification, you can even make the images continue to rotate
while the page is already loaded, although some users find this a tad
irritating.


Regards: Ayudh

+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank.   |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv              |
+----------------------------------------------------------------+

----- Original Message -----
From: "Brian Gilbert" <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 3:29 PM
Subject: [cfaussie] Image randomizer


> Does anyone know of a CF method to do the following?
>
> http://www.alistapart.com/articles/randomizer/
>
> Thanks,
>
> Brian
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to