Random Image
The following will generate a random image with link. It does require some
customization so only experienced developers should use it. You will need to change
link information, image information, and the number of images the script can display.
If you have five images that can possibly be displayed you will need to change the '2'
in the line rnumb += Math.floor(Math.random()*2); to '5'.
<html>
<head>
<title></title>
</head>
<body>
<script language="javascript">
<!--
var b1dis = "<a href=\"";
var bdis = "\"><img src=\"";
var edis = " width=\"110\" height=\"100\" alt=\"some text\" border=\"0\"></a>";
var rnumb = "";
var img = "";
rnumb += Math.floor(Math.random()*3);
img = rnumb;
if (img == "0") {
document.write(b1dis+ "page1.html" +bdis+ "images/page1.gif\"" +edis);
}
if (img == "1") {
document.write(b1dis+ "page2.html" +bdis+ "images/page2.gif\"" +edis);
}
if (img == "2") {
document.write(b1dis+ "page3.html" +bdis+ "images/page3.gif\"" +edis);
}
// -->
</script>
</body>
</html>
Notes:
- Please follow the instructions above.
- To ensure the code is copied correctly, please click here.
