Rotate images randomly but without dups on same page
Currently i'm using this PHP code to create random images in fixed DIVS.
I have 7 jpgs that i randomly want to load in a <div>. My client doesn't want to have PHP so i'm thinking JS.
Is there anybody out there who wants to help me. I can find a lot of JS load random files. But the tricky thing is that the JS is not allowed to duplicate. So he can use each JPG once.
// rotate images randomly but w/o dups on same page - format:
// <img src='rotate.php?i=0'> - rotate image #0 - use 'i=1'
// for second, etc
// (c) 2004 David Pankhurst - use freely, but please leave in my credit
$images=array( // list of files to rotate - add as needed
$secondsFixed=1; // seconds to keep list the same
for ($i=0;$i<$total;++$i) // shuffle list 'randomly'
$index=(int)($_GET['i']); // image index passed in
$i=$index%$total; // make sure index always in bounds
header("Location: $file"); // and pass file reference back