Help - Search - Members - Calendar
Full Version: Well phooey.....
Get Paid Forum - Get Paid Discussion > Webmaster's Corner > Advertising Section related to Running a website > Script Exchange > For Sale Archive
freeandeasy
I know someone posted the code for a javascript banner rotator in this forum somewhere but I can't find it.
Can someone paste the code for one, please?
TIA!
hillbilly01
Hi freeandeasy

Here's one I use on my home page aa.gif only one prob is it dont have stat's
you can see it working just go to my sig page aa.gif


<script language="JavaScript">
<!--

// do not edit the part below
function adArray() {
for (i=0; i*2<adArray.arguments.length; i++) {
this[i] = new Object();
this[i].src = adArray.arguments[i*2];
this[i].href = adArray.arguments[i*2+1];
}
this.length = i;
}
function getAdNum() {
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
return ad_num;
}

// below you can add more banners by adding a line like the others
var ads = new adArray(
"http://users.pandora.be/dideco/PlazaBanner02.gif","http://webmastersplaza.resourcez.com",
"http://users.pandora.be/dideco/DidecoBanner1.gif","http://iezie.be/dideco-online",
"http://users.pandora.be/dideco/ParaBanner1.gif","http://iezie.be/paranormaliteit");

// don't change this line
var ad_num = getAdNum();

// change this to adapt the script view to your site lay-out
document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD '
+'ALIGN=CENTER><FONT SIZE=1><B>'
+'</FONT></TD><TD>'
+'<A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
+'HEIGHT=60 WIDTH=468 BORDER=0 name=js_ad></A></TD></TR></TABLE></CENTER>');


// do not edit below
link_num = document.links.length-1;

function rotateSponsor() {
if (document.images) {
ad_num = (ad_num+1)%ads.length;
document.js_ad.src = ads[ad_num].src;
document.links[link_num].href = ads[ad_num].href;

// below you can set the time (in milliseconds) after which the banner will swap
// Change only the number!
setTimeout("rotateSponsor()",5000);
}
}

// set here the same time as above!
// Change only the number!
setTimeout("rotateSponsor()",5000);

// -->
</script>
hillbilly01
one banner is not working on my site but going to fix that now ab.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.