• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need to have images randomize on my website, anyone know how

Basically I want banners to change every time the page is accessed so its even, anyone know how to do this with like a javascript or something
 
Aww Dude my friend was just asking about this last week, cept his was to randomize the background picture. He figured it out but he's not online right now.... if you don't find an answer by the morning I should have one for you


BTW I don't know if you'll be able to see it in their code or not but the guys over at Penny Arcade are doing what I think you want to do with their banners.
 
if you don't mind/can use perl/cgi scripts then go to your fav search engine google and type in cgi resources. there are a lot of excellent scripts out there that do what you need
 
i'm not sure how feasible this is with client side code... either the client would have to download all the banners, and the script work from there, or there would have to be some sort of push pop functionality, where the javascript sends a request every once in a while... that might require the banners to be in an iframe or something like that.
 
i like this one better

<!-- in head -->
<script language="JavaScript">
<!-- Hide from old browsers
// Copyright © 1999 Doug Popeney
// Created by Doug Popeney (easyjava@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com

var imagenumber = 4 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1;
images = new Array
images[1] = "image1.jpg"
images[2] = "image2.jpg"
images[3] = "image3.jpg"
images[4] = "image4.jpg"

var image = images[rand1]
// -- End Hiding Here -->
</script>



<!-- in body -->
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write('<IMG SRC="' + image + '">')
// -- End Hiding Here -->
</script>
 
Back
Top