|
Example
The above example is images of some of our different advertisers.
If you refresh or reload the page in your browser, you should get a different image (if
you get the same, try again.) We wrote
this basic script to allow viewers of your web page to get a new look
each time they come to your web page.
Source code
<script language="JavaScript"><!--
//Javascript Created by Computerhope
http://www.computerhope.com
//store the quotations in arrays
images = new Array(4);
images[0] = "<a href =
'http://www.computerhope.com/index.htm'><img src='http://www.computerhope.com/banners/banner.gif'
alt='Visit Computer Hope'></a>";
images[1] = "<a href =
'http://www.computerhope.com/history/index.htm'><img src='http://www.computerhope.com/banners/banner2.gif'
alt='Computer History'></a>";
images[2] = "<a href =
'http://www.computerhope.com/index.htm'><img src='http://www.computerhope.com/banners/banner3.gif'
alt='Visit Computer Hope'></a>";
images[3] = "<a href =
'http://www.computerhope.com/newslet.htm'><img src='http://www.computerhope.com/banners/banner4.gif'
alt='Computer Hope Newsletter'></a>";
index = Math.floor(Math.random() *
images.length);
document.write(images[index]);
//done
// --></script><br> |