PDA

View Full Version : Random Background Image in Postbit?


Jaxel
08-19-2008, 04:15 AM
I saw some other forums do this, so I know its possible...

If you visit a page on my forum: http://www.8wayrun.com/showthread.php?t=1

You will see that the postbit has a background image. If you keep refreshing the page, you will see that the background image rotates between another image. I am doing this with a script I found here: http://alistapart.com/articles/randomizer/ . I call the script in the background section of First Alternating Color in my style preferences with: #EEEEEE url(http://www.8wayrun.com/customstyles/exm-light/postbit.php) no-repeat top rightThe postbit.php automatically searches the directory and randomly choses and image to display.

So whats the problem? Well as you will notice, even though the randomizer works, it only works ONCE per page load. I would like it to randomly chose and image everytime its called in the page... which should be in every post bit. With any luck, each post will have it's own background image. Does anyone know how I can do this? Possibly be able to fix the code in the postbit.php? Please, no javascript; and I would prefer to be able to continue calling it in the CSS stylesheets; the less template editing the better.