
September 7th, 2009, 10:39 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Location: USA
Posts: 2
Time spent in forums: 23 m 21 sec
Reputation Power: 0
|
|
My rotating banners won't open in a new window
Hello,
I am new to JavaScript and I had someone else help me with creating what you will see below. We can't figure out why using the window.open or the target="_blank" will not allow the rotating banners to open in a new window.
Any help you can give me is greatly appreciated!!
Thank you,
RaeRene
Code:
<html>
<head>
<script language="JavaScript">
<!-- Beginning of JavaScript -
if (document.images) {
ads = new Array(11);
ads[0] = "SoC125x125.gif";
ads[1] = "Lion125x125-r.gif";
ads[2] = "SP125x125-3.gif";
ads[3] = "SoC125x125-cos.gif";
ads[4] = "Ruby125x125.gif";
ads[5] = "SoC125x125-rock.gif";
ads[6] = "Lion125x125-b.gif";
ads[7] = "SP125x125-1.gif";
ads[8] = "SoC125x125-hal.gif";
ads[9] = "Ruby125x125-1.gif";
ads[10] = "SP125x125-2.gif";
}
newplace = new Array(6);
newplace[0] = "http://279795"
newplace[1] = "http://287329"
newplace[2] = "http://334938"
newplace[3] = "http://279795"
newplace[4] = "http://360522"
newplace[5] = "http://279795"
newplace[6] = "http://287329"
newplace[7] = "http://334938"
newplace[8] = "http://279795"
newplace[9] = "http://360522"
newplace[10] = "http://334938"
var timer = null
var counter = 0
function banner() {
timer=setTimeout("banner()", 6000);
counter++;
if (counter >= 11)
counter = 0;
document.bannerad.src = ads[counter];
}
function gothere() {
counter2 = counter;
window.location.href = newplace[counter2];
}
// - End of JavaScript - -->
</script>
</head>
<body bgcolor="661100" onload="banner()">
<a href="javascript:gothere()"><img src="SoC125x125.gif" border="0" name="bannerad" ></a>
</body>
</html>
|