ramdom bg images
Hey, does anybody know how those random backgrounds work. like... Surfstation mabye someone nows where i can find a tutorial explaining how to do it. Thank you. 
___________________
m a c h o s c r a w n
Login |
ramdom bg imagesramdom bg imagesCurrently viewing this thread: 1 (0 members and 1 guests) ramdom bg images Hey, does anybody know how those random backgrounds work. like... Surfstation mabye someone nows where i can find a tutorial explaining how to do it. Thank you. ___________________ m a c h o s c r a w n i recommend doing it in PHP, i have a tutorial on my site that talks about randomization: http://www.brilla.org but here's a quick solution in javascript: <script> bg[0] = "bahooboris.gif"; // what have you... var num = Math.round(Math.random() * (bg.length - 1)); document.write("<style>body{ background-image: url(" + bg[num] + "); } </style>") </script> ___________________ thanks alot sparky thats exactly what i needed. ___________________ m a c h o s c r a w n fredmvStatus: Offline!
An alternative approach:
___________________ The best way:
works in all browsers regardless if javascript is off Well its a client side question, and I provided the best answer, which happens to be server side. If someone asks a client side question but the best answer is server side am i supposed to make a new thread in the server side forum saying that that answer is the best. |
Copyright ©1999-2009 Neverside. All rights reserved.
Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach
NeverAPI generated this page in 0.0082 seconds.