Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Background Picture 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I make a Web page the displays a random background picture everytime that the page is loaded.
 
This works great, is there anyway to make is so I can display hundreds of random pictures instead of three? Thanks
 
It is easy to modify it to do that.
First you would need to declare the images like the 3 in the script, but do all of the ones you want. Then you have to have an else if statement for each one. If you're talking about hundreds, that's alot of coding. Perhaps there is an easier way. Hut you still have to have a refference to each image.
 
What is the range for the random number that is generated? Is is like from .001 to 1? or is it different?
 
A slightly different question:
Can Javascript produce a randomly selected background image for a table, table row or table cell instead of the page's body background?
Thanks plenty!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top