This is a discussion on "[SOLVED] Randomizing BG Tiles" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Randomizing BG Tiles are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Randomizing BG Tiles
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Randomizing BG Tiles
Hi, I have a bit of an unusual task and cant work this one out, wondered if anyone here can help me out.
I need to randomize a tiled background so that each tile is different to the next and when refresh is hit the order changes again. I have 20 tiles 200x50 and will be adding more, so far I can randomize them but its all the same one on the page. It does not matter if the same 2 tiles are next to each other as the more I add the less likely this will occur. |
|
|
|
||||
|
Re: Randomizing BG Tiles
you'd have to use javascript or php for this I guess.
is your site using PHP? if not, resort to JS.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: Randomizing BG Tiles
a list apart has a good tutorial on randomizing images
you can also start with this code that I *borrowed* from codingforums and amend as you require
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
|||
|
Re: Randomizing BG Tiles
Thanks for the help, it sent me in just the right direction.
I have an idea of using the tiles down each side of the page with the main site in the middle, every time the page is revisited the borders look different. I wanted it to always finish at the bottom of the page no matter what size the window was and now it adds more as the window is stretched. It also now randomizes again when the page is resized too, which I like.
Last edited by nastybadger; Oct 3rd, 2007 at 14:09. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] 1 solved problem causes another | delusion | Web Page Design | 9 | Dec 21st, 2007 08:12 |
| Adding "Topic Solved" for solved topics | AdRock | Webforumz Suggestions and Feedback | 21 | Oct 4th, 2007 15:08 |
| Randomizing Display Trouble | coastercraverjim | PHP Forum | 0 | Jun 5th, 2006 18:27 |