Author Topic: An HTML / Random Image Display Question...  (Read 2062 times)

0 Members and 1 Guest are viewing this topic.

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
An HTML / Random Image Display Question...
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.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
An HTML / Random Image Display Question...
Inferno's main page does something like that. Ask them.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
An HTML / Random Image Display Question...
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!

 
An HTML / Random Image Display Question...
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 :)
« Last Edit: September 02, 2003, 02:32:57 pm by 1363 »
"Igitur qui desiderat pacem, praeparet bellum." --- Vegetius

 

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
An HTML / Random Image Display Question...
Just use the code tags:

[*code] [*/code]

  
An HTML / Random Image Display Question...
I did, it didn't show up here. Well, you should have it through PM anyhow ;)
"Igitur qui desiderat pacem, praeparet bellum." --- Vegetius

 
 

Offline Stealth

  • Braiiins...
  • 211
An HTML / Random Image Display Question...




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)
« Last Edit: September 02, 2003, 04:20:49 pm by 594 »

 

Offline Zeronet

  • Hanger Man
  • 29
An HTML / Random Image Display Question...
Could use a monkey.
Got Ether?

 

Offline Xelion

  • 28
  • In the Ether
An HTML / Random Image Display Question...
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
« Last Edit: September 03, 2003, 07:35:05 am by 325 »

 

Offline J.F.K.

  • 29
An HTML / Random Image Display Question...
I always wondered how sites did that, I assumed it was scripted or something. High funkiness. :)
.
[font="SerpentineDBol"]. . . . W H O . I S . T H E . M A N , . W H O . I S . T H E . M Y T H ?[/font]

 

Offline Woolie Wool

  • 211
  • Fire main batteries
An HTML / Random Image Display Question...
Quote
Originally posted by Zeronet
Could use a monkey.


What is it with you and monkeys?
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta

 

Offline Stealth

  • Braiiins...
  • 211
An HTML / Random Image Display Question...
yeah the one Max posted seems to be the best :)