![]() |
|
Welcome to the UndergroundScene Forums forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
gimp
Join Date: Aug 2001
Location: Scotland
Posts: 14,227 Band: A band of merry men
![]() |
random image
kate, i have this working on my own site.
This is the code for the page that i use it on. <HTML> <HEAD> <TITLE>stuff</TITLE> </HEAD> <BODY> <SCRIPT LANGUAGE=JavaScript><!-- document.write("<IMG SRC='random" + Math.ceil(Math.random() * 3) + ".jpg' WIDTH=300 HEIGHT=225 BORDER=1>") //--></SCRIPT> </BODY> </HTML> The code in bold is what you are interested in. basically it randomly calls for an image named something between or equal to 1 and 3, because i have three possible random images. And each of these images is a jpg. if you have 5 random images, change the 3 to a 5. if you have gifs instead of jpgs then change jpg to gif. Also for the sake of simplicity the images have to be in the same folder as the html file that you use this code on. I hope this helps.
__________________
This community cannot survive without your continued support. galleries || links directory || profiles || wiki |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|