Hard Light Productions Forums
Off-Topic Discussion => General Discussion => Topic started by: Fineus on September 02, 2003, 01:04:44 pm
-
Hail all,
I'll cut to the chase. I need a piece of code that will select (at random) an image from a folder online, and display that image in the location where the code is placed on the web page. This is for background graphics - nothing interactive. I believe an example exists in VolitionWatchs random ship image selection on FSWatches banner graphic.
-
Inferno's main page does something like that. Ask them.
-
Say, that might just be the trick... Inferno guys - mind if I shamelessly rip that javascript from your source? I can provide kudos for its creation if need be :)
Edit: I'm forgetting myself, cheers GE!
-
Obviously not made by me so I won't take credit but here:
EDIT- I can't post the code caause HTML is on... :doubt:
EDIT2- Sent it through PM and it seems to work through PM :)
-
Just use the code tags:
[*code] [*/code]
-
I did, it didn't show up here. Well, you should have it through PM anyhow ;)
-
http://www.icglink.net/cgi-bin/icglink/helpdesk/kb.cgi?view=28
http://www.logicscripts.com/products/randomimage/
http://www.scriptarchive.com/ssi_image.html
-
unfortunately i can't take credit for the one below, although i can't take 100% credit for the one above, i did revise it a little ;) :D. the one below seems to work a lot better though :p :doubt:
if you want a really good one i guess i could program one from scratch, but that'd take a long time and only if you don't find one that you like. (which you'd better :D)
-
Could use a monkey.
-
I REPEAT THIS IS NOT PHP BUT JAVASCRIPT!
Damn Forum Code :hopping:
This can either go in an external .js (javascript) file or can be placed in the head section of the document.
Put the script below into the body section of your html document
This should be pretty straight forward... if it isn't I'll talk to u on ICQ and answer any queries you have..., just one thing though: RandInt(2) & (Math.random()*2) >> the 2 refers to the amount of images there are (in programming they start from 0 hence there are three images...you will have to edit this number if there are more or less images!)
I don't want any credit for this script...absolutely none :nod: :D
-
I always wondered how sites did that, I assumed it was scripted or something. High funkiness. :)
-
Originally posted by Zeronet
Could use a monkey.
What is it with you and monkeys?
-
yeah the one Max posted seems to be the best :)