Help - Search - Members - Calendar
Full Version: Want a banner rotator?
Get Paid Forum - Get Paid Discussion > Webmaster's Corner > General Discussion on Building, Running & Making Money from a Website
russ20
The banner will rotate every 5 secs or 5000 millisecs << you can change this by going: setTimeout("rotatebanners()",5000) and change the number.
quite handy aa.gif


<!-- Put this text in the HEAD section of the HTML -->

<script language="JavaScript">
<!--
var AdNum = 0;

function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}

links = new initArray(
"yeayea.gif",
"hello.gif",
"okok.gif",
"whatva.gif",
"blah.gif"
)


images = new initArray(
"http://www.hellhelo.com",
"http://www.whanter.net",
"http://www.hehehe.com",
"http://www.blahbla.com",
"http://www.whateva.com"
)


alttext = new initArray(
"Textdisplay",
"Textdisplay",
"Textdisplay",
"Textdisplay",
"Textdisplay"
)

// -->
</script>
<!-- End Banner Rotator HEAD Code -->










<!-- Put this text in the BODY section of the HTML -->

<script language="JavaScript">
<!--
var bannerlink = "image"
function rotatebanners() {
if (AdNum == 5) {
AdNum = 0
}
document.BannerAd.src=images[AdNum]
document.BannerAd.alt=alttext[AdNum]
setTimeout("rotatebanners()",5000)
bannerlink = links[AdNum]
AdNum++
}

function changelink() {
location = bannerlink
}
// -->
</script>

<a href='java script:changelink()'><img src="web" name="BannerAd" alt="" ></a>

<script language="JavaScript">
rotatebanners();
</script>
<!-- End Banner Rotator BODY Code -->

russ20
lexiekinz
QUOTE (russ20 @ Jan 21 2003, 07:17 PM)
The banner will rotate every 5 secs or 5000 millisecs << you can change this by going: setTimeout("rotatebanners()",5000) and change the number.
quite handy aa.gif


<!-- Put this text in the HEAD section of the HTML -->

<script language="JavaScript">
<!--
var AdNum = 0;

function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}

links = new initArray(
"yeayea.gif",
"hello.gif",
"okok.gif",
"whatva.gif",
"blah.gif"
)


images = new initArray(
"http://www.hellhelo.com",
"http://www.whanter.net",
"http://www.hehehe.com",
"http://www.blahbla.com",
"http://www.whateva.com"
)


alttext = new initArray(
"Textdisplay",
"Textdisplay",
"Textdisplay",
"Textdisplay",
"Textdisplay"
)

// -->
</script>
<!-- End Banner Rotator HEAD Code -->










<!-- Put this text in the BODY section of the HTML -->

<script language="JavaScript">
<!--
var bannerlink = "image"
function rotatebanners() {
if (AdNum == 5) {
AdNum = 0
}
document.BannerAd.src=images[AdNum]
document.BannerAd.alt=alttext[AdNum]
setTimeout("rotatebanners()",5000)
bannerlink = links[AdNum]
AdNum++
}

function changelink() {
location = bannerlink
}
// -->
</script>

<a href='java script:changelink()'><img src="web" name="BannerAd" alt="" ></a>

<script language="JavaScript">
rotatebanners();
</script>
<!-- End Banner Rotator BODY Code -->

russ20

Kewl .

Will it rotate more than 5 banners ?
russ20
It's probably easier to use this banner rotator generator so you can specify exactly what you want aa.gif http://www.htmlbasix.com/banner.shtml

russ20
mazzie297
Cool! Thank both of you for sharing.
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.