The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

JS Random Table Background Image Rotator script wanted.

Hi All,
Has anybody an idea where I can get a free JS Random Background Image Rotator script? What I really want is, any time the site is visited or the refresh button is hit, a new background image should appear.

I have been searching the whole web for this script for the past two weeks with no success. I shall be very glad if somebody will help me out.

Hi Uneverno,
Thanks so much for the script but I still have some questions.
Where exactly do you want me to put the script?
Can I use it as a Table-background?

I guess I have to explain further where exactly I want the image to appear. What I really want is, I don't want the background image to appear in the whole page but rather a particular Table as a TABLE BACKGROUND.
e.g.
<table border="0" width="100%" align="center" style="background-image:url('../images/bg_image001.jpg'); background-repeat:no-repeat;">

Is that really possible? I have been seeing this function in a lot of websites.

The script you're using there isn't really 'random' at all - because, every time the user refreshes the page, another 'random' background is chosen, and it could easily be the same one, with the images repeating irregularly, over and over. Did you want a different background every time the page is loaded, cycling through a group of images in a fixed order? The 'fixed' order would be randomized, of course, every time someone came to your site.

The script you're using there isn't really 'random' at all - because, every time the user refreshes the page, another 'random' background is chosen, and it could easily be the same one, with the images repeating irregularly, over and over. Did you want a different background every time the page is loaded, cycling through a group of images in a fixed order? The 'fixed' order would be randomized, of course, every time someone came to your site.

Yea Adios that's exactly what I am looking for. Please could you help me out.

I am trying to use the script for a PHP integrated website whereby, I am having HEADER and FOOTER for all pages. But the problem is I am already having two other Javascripts in the HEADER so, somehow I am having problem getting the script to work. When I tried to get all the three javascripts to work, it's only the Random Table Background Image appearded to be working and rest were dead and distorted the whole page.

With the above problem, where exactly can I put the script and espacially; <base href="http://www.mydomain.com/js_imageslide/">.

Don't think that's answerable without seeing what's going on. Possibly over-writing an onload handler....could you post a url/more information about what you've got. Could (maybe) skip the PHP if that simplifies things; the scripts & the way they're being called could be enough.

The <base href... is completely unnecessary! Just used it to shorten the url for the sitepoint thumbnails used in the demo.