dxt-cobra
01-23-2016, 10:00 PM
Here is a way to add multiple banners to your site with an html module.
first create a banners.html file on your pc, and add this code.
Be sure to set your images in the adImages = new Array ( image links here ) and also the image within the body to point to your image locations.
You can also change the speed in the setTimeout( 2 * 5000 ).
//setTimeout(function, milliseconds);
My banner sizes are normally 900 x 100, this size works well for my site.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<title>Rotating Banners</title>
<script language="Javascript" type="text/javascript">
adImages = new Array("images/pb.png", "images/wf.png" )
thisAd = 0
imgCt = adImages.length
function rotate(){
if( document.images ){
thisAd++
if( thisAd == imgCt ){
thisAd = 0
}
document.adBanner.src=adImages[thisAd]
setTimeout("rotate()", 2 * 5000)
}
}
</script>
</head>
<body onload="rotate()">
<center><img src="images/wf.png" name="adBanner" alt="Ad Banner" /></center>
</body>
</html>
when your done, upload it to your forum directory.
then add a html module were you want it and add this line here.
<iframe src="http://www.YOURSITE.com/forums/banners.html" width='99%' height='120'></iframe>
Be sure to edit the link and put your site domain. and save it.
thats it all done, your banners should display rotate.
first create a banners.html file on your pc, and add this code.
Be sure to set your images in the adImages = new Array ( image links here ) and also the image within the body to point to your image locations.
You can also change the speed in the setTimeout( 2 * 5000 ).
//setTimeout(function, milliseconds);
My banner sizes are normally 900 x 100, this size works well for my site.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<title>Rotating Banners</title>
<script language="Javascript" type="text/javascript">
adImages = new Array("images/pb.png", "images/wf.png" )
thisAd = 0
imgCt = adImages.length
function rotate(){
if( document.images ){
thisAd++
if( thisAd == imgCt ){
thisAd = 0
}
document.adBanner.src=adImages[thisAd]
setTimeout("rotate()", 2 * 5000)
}
}
</script>
</head>
<body onload="rotate()">
<center><img src="images/wf.png" name="adBanner" alt="Ad Banner" /></center>
</body>
</html>
when your done, upload it to your forum directory.
then add a html module were you want it and add this line here.
<iframe src="http://www.YOURSITE.com/forums/banners.html" width='99%' height='120'></iframe>
Be sure to edit the link and put your site domain. and save it.
thats it all done, your banners should display rotate.