Quantcast

Creativebits.org

an All Creative World site
Static's picture
138 pencils

random image? how to?

i'm making a website using lastest web-standarts and i need to know how can i make a random image generation for the header, i mean everytime then the user visits the site or reloads it, the header changes it's image, i saw this in several sites(i don't remeber where....).

thanks.

//Static

//Static

Commenting on this Forum topic is closed.

afterglow's picture
571 pencils

I use a random image generator on my frontpage using a bit of php scanning a predefined folder of images. http://www.afterglow.ie/images/soitbegins/rotate.php Reload for the desired effect. As for the script its on one of these.
-------------------------------
http://photomatt.net/scripts/randomimage
http://www.hiveware.com/imagerotator.php Link might be wonky at the mo
http://www.automaticlabs.com/
-------------------------------
www.afterglow.ie

kenyabob's picture
303 pencils

see below

kenyabob's picture
303 pencils

Although I originally wanted a script that would simply scan images in a folder on the server, ultimately picking one at random, I finally settled for the following script. It has worked pretty well, and besides having to enter image names in manually, I like it. See it in action here.

Static's picture
138 pencils

that's exactly what i was looking for! :D

and where i put the link to the image?
i mean my html is with , i need to put the image between the divs or
i can put in my css like:

#header{
background-image: url(bla bla bla/randomimage.php);

??

//Static

Creativebits is a blog about creativity, design and Macs. We also have a critique section where you can post your work to get opinions and a forum to discuss any design related topics.

Recommend us on Google

Latest critique

  • Butterfingers ad campaign
  • Critique for my logo

Marketplace