Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Random Image With Link
Insert into <HEAD>
<script language="JavaScript"> <!-- Hide from old browsers var imagenumber = 5 ; var randomnumber = Math.random() ; var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ; images = new Array images[1] = "IMAGE #1" images[2] = "IMAGE #2" images[3] = "IMAGE #3" images[4] = "IMAGE #4" images[5] = "IMAGE #5" var image = images[rand1] links = new Array links[1] = "LINK #1" links[2] = "LINK #2" links[3] = "LINK #3" links[4] = "LINK #4" links[5] = "LINK #5" var link = links[rand1] // -- End Hiding Here --> </script>
Insert into <BODY>
<script language="JavaScript"> <!-- Hide this script from old browsers -- document.write('<A HREF="' + link + '"><IMG SRC="' + image + '" border="0"></a>') // -- End Hiding Here --> </script>
Other Options
To put this in your page, copy this line into your tag. Now put this part in the body of your document. <script language="JavaScript"> <!-- Hide this script from old browsers -- document.write('<A HREF="' + link + '"><IMG SRC="' + image + '" border="0"></a>') // -- End Hiding Here --> </script> To add more images, first change the number "5" in script that you put in the part of your document to the number of images that you have. Then before the line "images = new Array" add images[6] = "IMAGE #6" and change the numbers appropriately. For example, the next number would be "7" and so on. Same goes for the links!