logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Dreamweaver General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 06-19-2006, 08:40 AM   #1
Jayboyband
 
Join Date: Jun 2006
Location: Windsor, UK
Posts: 2
Default 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...

http://www.development-partners.co.uk/

Cheers
Jayboyband is offline   Reply With Quote
Old 06-19-2006, 11:02 AM   #2
Creative Insanity
Banned
Creative Insanity's Avatar
 
Join Date: Oct 2005
Location: KiwiLand (stalk that far dj LOL)
Posts: 1,967
Default

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.
Creative Insanity is offline   Reply With Quote
Old 01-17-2009, 07:49 PM   #3
rediffusion
 
Join Date: Jan 2009
Posts: 1
Default

Hi,

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:
http://www.randam.org/NickWilson/test.html

but want a random image to appear each time:
http://www.randam.org/NickWilson/ima...rs/image01.jpg
http://www.randam.org/NickWilson/ima...rs/image02.jpg
http://www.randam.org/NickWilson/ima...rs/image03.jpg

Can anybody help?

thanks
R
rediffusion is offline   Reply With Quote
Old 01-18-2009, 07:02 PM   #4
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

This thread is over 2 years old.
Please start your own thread.
Welcome to the forums btw!
domedia is offline   Reply With Quote
Old 01-19-2009, 01:01 AM   #5
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,170
Default

heres a php answer to this , havent used it but should work

<?php

/*
* 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\" />";

?>
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:14 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com