C
Chris Curtis
Actually I'm not sure even newbie qualifies! I originally posted this in the
Java help group!!
I'm trying to adapt an ad rotating script I found on the net yesterday.
The author's contact details no longer work.
All I've done is add a variable to create a related alt tag.
However, all that displays is the first word!
I suspect it is something simple.
Remember, I'm a total novice!
Regards
Chris Curtis
The page can be viewed at
http://www.brss.org.uk/indexbannerscrpt.htm
The relevant part of the script:
var refreshTime = 5000;
var numAds = 3;
function makeAd() {
this.width = ''
this.height = ''
this.src = ''
this.href = ''
this.alt = ''
this.mouseover = ''
}
var ads = new Array()
for(var i = 1; i <= numAds; i++) { ads = new makeAd() }
i = 1;
ads.width = "200"
ads.height = "130"
ads.src = "images/blackcatcomputers.jpg"
ads.href = "http://www.blackcatcomputers.co.uk"
ads.alt = "Black Cat Computers Tel 01527 889584"
ads.mouseover = "Black Cat Computers Tel 01527 889584"
i++
DETAILS OF OTHER TWO ADS GO HERE
var myCode = '';
do {
var n= Math.floor(Math.random() * (numAds + 1) + 1);
} while(n > numAds);
var current_ad = n;
myCode = getCode(n);
function getCode(adNumber){
var tempCode = ""
tempCode += ('<a href="'+ ads[adNumber].href + ' "target=_blank"' +
ads[adNumber].width +'" \n')
tempCode += ('onMouseOver="status=\''+ ads[adNumber].mouseover +'\';return
true" \n')
tempCode += ('onMouseOut="status=\'\'"> \n')
tempCode += ('<img src="' + ads[adNumber].src + '" alt=' +
ads[adNumber].alt + '" width=' + adsadNumber].width)
tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
tempCode += ('\n height=' + ads[adNumber].height + ' border=0 >')
tempCode += ('</a>')
return tempCode;
}
Java help group!!
I'm trying to adapt an ad rotating script I found on the net yesterday.
The author's contact details no longer work.
All I've done is add a variable to create a related alt tag.
However, all that displays is the first word!
I suspect it is something simple.
Remember, I'm a total novice!
Regards
Chris Curtis
The page can be viewed at
http://www.brss.org.uk/indexbannerscrpt.htm
The relevant part of the script:
var refreshTime = 5000;
var numAds = 3;
function makeAd() {
this.width = ''
this.height = ''
this.src = ''
this.href = ''
this.alt = ''
this.mouseover = ''
}
var ads = new Array()
for(var i = 1; i <= numAds; i++) { ads = new makeAd() }
i = 1;
ads.width = "200"
ads.height = "130"
ads.src = "images/blackcatcomputers.jpg"
ads.href = "http://www.blackcatcomputers.co.uk"
ads.alt = "Black Cat Computers Tel 01527 889584"
ads.mouseover = "Black Cat Computers Tel 01527 889584"
i++
DETAILS OF OTHER TWO ADS GO HERE
var myCode = '';
do {
var n= Math.floor(Math.random() * (numAds + 1) + 1);
} while(n > numAds);
var current_ad = n;
myCode = getCode(n);
function getCode(adNumber){
var tempCode = ""
tempCode += ('<a href="'+ ads[adNumber].href + ' "target=_blank"' +
ads[adNumber].width +'" \n')
tempCode += ('onMouseOver="status=\''+ ads[adNumber].mouseover +'\';return
true" \n')
tempCode += ('onMouseOut="status=\'\'"> \n')
tempCode += ('<img src="' + ads[adNumber].src + '" alt=' +
ads[adNumber].alt + '" width=' + adsadNumber].width)
tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
tempCode += ('\n height=' + ads[adNumber].height + ' border=0 >')
tempCode += ('</a>')
return tempCode;
}