PDA

View Full Version : vB4 Banner Rotator Favourite?


oddmud
12-29-2010, 07:52 PM
What is your favourite program for banner ads? Flash/JPG/PNG/GIF etc..

What works best for you and why?

shooptek
12-29-2010, 11:09 PM
I am interested in this too. I currently use this code to rotate between two images in a CMS widget on the homepage:



<script language="JavaScript">

i=0;
var ads = new Object();
var header='<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD '
+ 'ALIGN=CENTER><FONT SIZE=2 FACE=Arial>';
ads[i++] = header
+'</TD><TR></TR><TD><A HREF="(IMAGE TARGET LINK HERE)" TARGET'
+'="_top"><CENTER><IMG SRC="(IMAGE URL HERE)" width="XXX" height="XXX" BORDER=0 ALT="(IMAGE ALT TXT HERE)"></CENTER>'
+'</A></TD></TR></TABLE></CENTER>';
ads[i++] = header
+'</TD><TR></TR><TD><A HREF="(IMAGE TARGET LINK HERE)" TARGET'
+'="_top"><CENTER><IMG SRC="(IMAGE URL HERE)" width="XXX" height="XXX" BORDER=0 ALT="(IMAGE ALT TXT HERE)"></CENTER>'
+'</A></TD></TR></TABLE></CENTER>';
ads.length = i;
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
document.write(ads[ad_num]);
// -->
</script>



The images alternate which is loaded each time a user loads the page. I would like to find a solution which allows me to use more than two images, however. I probably can just edit this code but every time I have tried it doesnt work.