Hello,
I am incorporating a banner ad rotation on this site Im working on and i got it working but the first banner is not loading up right off when the page loads;its adding the time between each banner to the beginning..how do you get this code to make the banner come right up? I got the code from Javascriptsource.com I pasted the code they used below.
The site Im using this on is at <!-- m --><a class="postlink" href="http://www.onqtech.com/test/">http://www.onqtech.com/test/</a><!-- m -->
(banner is at top, in top frame)
Thanks!
Kevin
---------------------
<!-- TWO STEPS TO INSTALL BANNER ROTATER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Markus Fischer (<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->) -->
<!-- Web Site: <!-- m --><a class="postlink" href="http://josefine.ben.tuwien.ac.at/~mfischer/">http://josefine.ben.tuwien.ac.at/~mfischer/</a><!-- m --> -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! <!-- m --><a class="postlink" href="http://javascript.internet.com">http://javascript.internet.com</a><!-- m --> -->
<!-- Begin
var mfBanners = [
['http://www.banner1-url-here.com', 'http://imageserv.imgis.com/images/Ad13700St1Sz1Sq1_Ban1.gif'],
['http://www.banner2-url-here.com', 'http://imageserv.imgis.com/images/Ad13189St1Sz1Sq5_Ban10.gif']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfBannerIndex = 0;
function mfBannerChange() {
var htmlString = '<a target="_blank" href=http://www.webdeveloper.com/forum/archive/index.php/"'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src=http://www.webdeveloper.com/forum/archive/index.php/"'+mfBanners[mfBannerIndex][1]+'"></a>';
if( mfIe) {
document.all.banner.innerHTML = htmlString;
}
else {
document.layers["banner"].document.open();
document.layers["banner"].document.write( htmlString);
document.layers["banner"].document.close();
}
if(mfBannerIndex < mfBanners.length - 1)
mfBannerIndex++;
else
mfBannerIndex = 0;
}
setInterval("mfBannerChange()", 5000);
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<div id="banner" style="position:absolute; top:300; left:171;"></div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href=http://www.webdeveloper.com/forum/archive/index.php/"http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.74 KB -->
I am incorporating a banner ad rotation on this site Im working on and i got it working but the first banner is not loading up right off when the page loads;its adding the time between each banner to the beginning..how do you get this code to make the banner come right up? I got the code from Javascriptsource.com I pasted the code they used below.
The site Im using this on is at <!-- m --><a class="postlink" href="http://www.onqtech.com/test/">http://www.onqtech.com/test/</a><!-- m -->
(banner is at top, in top frame)
Thanks!
Kevin
---------------------
<!-- TWO STEPS TO INSTALL BANNER ROTATER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Markus Fischer (<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->) -->
<!-- Web Site: <!-- m --><a class="postlink" href="http://josefine.ben.tuwien.ac.at/~mfischer/">http://josefine.ben.tuwien.ac.at/~mfischer/</a><!-- m --> -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! <!-- m --><a class="postlink" href="http://javascript.internet.com">http://javascript.internet.com</a><!-- m --> -->
<!-- Begin
var mfBanners = [
['http://www.banner1-url-here.com', 'http://imageserv.imgis.com/images/Ad13700St1Sz1Sq1_Ban1.gif'],
['http://www.banner2-url-here.com', 'http://imageserv.imgis.com/images/Ad13189St1Sz1Sq5_Ban10.gif']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfBannerIndex = 0;
function mfBannerChange() {
var htmlString = '<a target="_blank" href=http://www.webdeveloper.com/forum/archive/index.php/"'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src=http://www.webdeveloper.com/forum/archive/index.php/"'+mfBanners[mfBannerIndex][1]+'"></a>';
if( mfIe) {
document.all.banner.innerHTML = htmlString;
}
else {
document.layers["banner"].document.open();
document.layers["banner"].document.write( htmlString);
document.layers["banner"].document.close();
}
if(mfBannerIndex < mfBanners.length - 1)
mfBannerIndex++;
else
mfBannerIndex = 0;
}
setInterval("mfBannerChange()", 5000);
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<div id="banner" style="position:absolute; top:300; left:171;"></div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href=http://www.webdeveloper.com/forum/archive/index.php/"http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.74 KB -->