View Single Post
Old 06-23-2008, 11:21 PM  
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 49,703
Quote:
Originally Posted by uvort View Post
Anyone know of a simple banner rotator script with static html where you can add banners through a web based admin and the banners display randomly on your page? I need something besides Openx and LedAds.

Thanks in advance!

Hi Uvort -

Here is a super simple banner rotator script. Just drop this into any HTML page you are running. Copy your banners to your server and adjust the URL's for each.

<SCRIPT language=JavaScript type="text/javascript">
var img_width = "480";
var img_height = "60";
var img_title = "Click Here";

var ad=new Array();
ad[0]='http://www.YourWebsite.com/banner0.jpg';
ad[1]='http://www.YourWebsite.com/banner1.jpg';

var links=new Array();
links[0]='http://www.WebSite1com';
links[1]='http://www.WebSite2.com';

var text=new Array();
text[0]='Any Text you Want 1';
text[1]='Any Text you want 2';

var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'"><img src="'+ad[xy]+'" alt="'+img_title+'" border = "0"><br>'+text[xy]+'</a>');
</SCRIPT>


First Part:
Change the width and height values to be the same size as your banners. You can change the tital of the banners ("click here") to be anything you want.

Second Part: Make sure the URL's for each banner are correct.

Third Part: Use any text or caption you want for each banner.

You can have as many banners as you like. Just make sure to give each one a unique number in the variable list (ad[2], ad[3], ad[4], and then links2, links3, links4, etc.

The script will select a banner at random and display it. With a little tweaking, you can give some banners more weight so that they load more often than others if you wan them to.

Good luck!
__________________

Custom Coding | Videochat Solutions | Age Verification | IT Help & Support
www.2Much.net
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote