|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hey Everyone,
I've been playing around with a website I'm working on and I'm trying to get a background image of a table cell to change (at random) everytime you go to the site. I'm honestly not sure if it can be done or not everything I've done to make it work has fallen flat. any ideas how I could make this work ? Cheers All |
|
#2
|
||||
|
||||
|
Yup - it can be done. If you plan it out on paper, you'll see it's quite easy to do.
Create a list of available images (this can be hardcoded, or if you have access to the server-side, dynamic) Generate a random number within the bounds of you image array list. Print the value of the array index choosen from the random number. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > random td background ?!?! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|