I'm having a hard time getting our header image to rotate randomly. I've tried a javascript I've used succesfully in the past, and I've tried the old "rotate.php" document trick. Alas, neither is succeding, and I know I've got the code I'm using placed and called correctlly.

Does anyone have a good random image rotation code they've used succesfully within Drupal?

We're using the Interlaced theme at the moment.

Thanks in Advance.

Comments

Csabo’s picture

Did you mean that a random image would show up each time the page is requested? We have that on our front page, the code is:

<img src="/images/front/makeover<?php print rand(1,5) ?>.jpg" width="290" height="195" alt="alt tag" />

We have 5 images named makeover1.jpg - makeover5.jpg. Pretty simple.

sepeck’s picture

Maybe this?
http://drupal.org/node/85640

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

mirko’s picture

Steven's link is great. I've used the "A list apart" rotator, it works great.

gamehengraphics’s picture

The theme we're using is all CSS, so the php style of calling the rotate.php document wasn't working. One of the comments on http://drupal.org/node/85640 provides the little CSS tweak we needed.