Back

Slide Show 005

 

 

This script displays a random image every time the page is loaded.  This is a good script to show a different image every time the visitor visits the website. So it looks fresh. Images in yellow.  Document tag in pink.

 

Script instructions for <HEAD></HEAD> tags

<!-- Paste between the <HEAD></HEAD> tags. -->
<!-- ashesh.com.np -->
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">

myPics = new Array("images/bh1.jpg","images/bh2.jpg","images/bh3.jpg","images/bh4.jpg")
imgCt = myPics.length

function choosePic() {
if (document.images) {
randomNum = Math.floor
((Math.random() * imgCt))
document.birdHouse.src=myPics[randomNum]
}
}


</SCRIPT>


 

Script  for the <BODY> tag of the HTML Document

onLoad="choosePic()"

Paste where needed it the body of the HTML Document.

<!-- Paste where needed in the HTML -->

<div align="center">
<center>
<table border="5" cellpadding="5" cellspacing="0" width="23%">
<tr>
<td width="100%">
<p align="center">
<img border="0" src="images/bh1.jpg" width="200" height="311" name="birdHouse"></td>
</tr>
</table>
</center>
</div>


 

 

Paste script between the <HEAD></HEAD> tags.

Script  for the <BODY> tag of the HTML Document

Paste script where needed in the body of the HTML Document.


� Copyright 2009 Ashesh