Please Reload Me!
AdRotation
This page written with Java Script selects a random image from a set of images.
If you want, you can specify a URL to go with it.
If you use it, I would appreciate (but not require) a link back to my
home page. Thanks!
The function(s):
AdRotation(imageList,urlList)
AdRotationLong(imageList,urlList,params)
- imageList A string of space (or comma) seperated images
- urlList A string of space (or comma) seperated list of URL's
- params extra parameters to the img eg "width=152 height=136"
- Sorry you need a comma at the end of the string :-(
How To
- Include adrotation.txt in the HEAD section of you document.
- Add a function call inside your document:
<script language="javascript">
AdRotationLink("dog2-small.gif condo-view-small.gif spider3-small.gif ","dog2-small.gif condo-view-small.gif spider3-small.gif ");
</script>
<br>
- Another Example:
// If it's the dog, it goes to my home page, if it's the condo, goto the
// javascript page.
<script language="javascript">
AdRotation("dog2-small.gif condo-view-small.gif ","http://www.bloke.com/ http://www.bloke.com/javascript/ ");
</script>
<br>
<br>
- If you use the AdRotationLinkLong, useful parameters are setting border=0 and the width and height (eg "border=0 width=152 height=136");
- View the source of this document for an example.
Note that with the AdRotation() function it is not required
that all the images be the same size!!
Reloading the page will cause a different image to load (well at least
a randomly chosen image to be selected)!
Java is a registered trademark of Sun Microsystems, Inc.
Got JavaScript questions?
Maybe my JavaScript Board has the answers?
Cameron Gregory - cameron@bloke.com