|06-19-2006, 07:40 AM||#1|
Join Date: Jun 2006
Location: Windsor, UK
Random Background Change
Been asked by a client to change the background and hyperlink colours randomly on each page everytime a page is refreshed...
Is there some code out there somewhere that already has this sussed?
Hope this makes sense... I've found this site that does exactly what I want to do...
|06-19-2006, 10:02 AM||#2|
Join Date: Oct 2005
Location: KiwiLand (stalk that far dj LOL)
Simple.. if you study that site you will see it is just a simple matter of using a differant style sheet for each link like that site does.
|01-17-2009, 06:49 PM||#3|
Join Date: Jan 2009
I'm new here. I am also trying to work out how to make my background images random. I just need to create a page which features these images spanning 100%.
I have already created this:
but want a random image to appear each time:
Can anybody help?
|01-18-2009, 06:02 PM||#4|
Join Date: Dec 2003
This thread is over 2 years old.
Please start your own thread.
Welcome to the forums btw!
|01-19-2009, 12:01 AM||#5|
Join Date: Aug 2005
heres a php answer to this , havent used it but should work
* Name your images 1.jpg, 2.jpg etc.
* Add this line to your page where you want the images to
* appear: <?php include "randomimage.php"; ?>
// Change this to the total number of images in the folder
$total = "11";
// Change to the type of files to use eg. .jpg or .gif
$file_type = ".jpg";
// Change to the location of the folder containing the images
$image_folder = "images/random";
// You do not need to edit below this line
$start = "1";
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";