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 - Click Gives New Random Image
Insert into <HEAD>
<script language="JavaScript"> <!-- Hide from old browsers function pickimg(){ 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] document.randimg.src = image } // -- End Hiding Here --> </script>
Insert into <BODY>
<body onLoad="pickimg()"> <a href="" onClick="pickimg();return false;"><IMG SRC="YOUR IMAGE" name="randimg" border=0></a>
Other Options
An example is: <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080" onLoad="pickimg()"> or <body onLoad="pickimg()"> Now put this part in the body of your document. You need to change YOUR IMAGE. This image is what will define the height and width. <a href="" onClick="pickimg();return false;"><IMG SRC="YOUR IMAGE" name="randimg" border=0></a> -------------------------------------------------------------------------------- To add more images, first change the number "5" in script that you put in the <head></head> 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.