Demonstrating Random Image Rotator

The JavaScript Image Rotator is demonstrated on this page with random rotation. The rotating images are linked in this example, but they can be unlinked if you prefer. They all navigate to the same URL onclick here, but you can specify a different URL for each image.

The documentation includes setup instructions and shows how to list your images and optional links. A section on settings shows where to set the bRand property true for random rotation.

You can set up a particular image to display on page load as described in the documentation. However, if you want the first image to be selected at random, include a script segment with a call to the dw_getRandomImage function where you wish the rotating images to appear in your layout:

<script type="text/javascript">dw_getRandomImage(rotator1);</script>

The argument passed to the dw_getRandomImage function is a variable (an object literal) that holds your settings as shown in the documentation. An example is included in the download file.

More Demos and a Download

The JavaScript Image Rotator supports sequential rotation in addition to the random rotation shown here. See also an example that rotates images from a PHP directory listing. The download file includes several examples demonstrating even more features.