Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Galera, tenho esse código de banner rotativo, e gostaria que o mesmo abrisse a página em outra janela. Alguem poderia modifica-lo pra mim, pois não consegui. Obrigado!
Segue o cod.
<script language="JavaScript">
<!--
function banner(imgSource,url,alt,chance) {
this.imgSource = imgSource;
this.url = url;
this.alt = alt;
this.chance = chance;
}
function dispBanner() {
with (this) document.write("<A HREF=" + url + "><IMG SRC='" + imgSource + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.dispBanner = dispBanner;
banners = new Array();
banners[0] = new banner("http://www.assuguia.com.br/publicidade/figs/ext/380x60_assunet.gif",
"http://www.assuguia.com.br/index.htm",
"Acesse o site",
10);
banners[1] = new banner("http://www.assuguia.com.br/publicidade/figs/ext/promoc_clips_380x60.gif",
"http://www.assuguia.com.br/index.htm",
"Acesse o site",
10);
banners[2] = new banner("http://www.assuguia.com.br/publicidade/figs/ext/classific_380x60.gif",
"http://www.assuguia.com.br/index.htm",
"Acesse o site",
10);
banners[3] = new banner("http://www.assuguia.com.br/publicidade/figs/ext/bann_bate_papo.gif",
"http://www.assuguia.com.br/index.htm",
"Ir para o bate-papo",
35);
sum_of_all_chances = 0;
for (i = 0; i < banners.length; i++) {
sum_of_all_chances += banners.chance;
}
function randomBanner() {
chance_limit = 0;
randomly_selected_chance = Math.round((sum_of_all_chances - 1) Math.random()) + 1;*
for (i = 0; i < banners.length; i++) {
*chance_limit += banners**.chance;*
if (randomly_selected_chance <= chance_limit) {
*document.write("<A HREF=" + banners**.url + "><IMG SRC='" + banners**.imgSource + "' WIDTH=380 HEIGHT=60 BORDER=0 ALT='" + banners**.alt + "'></A>");*
*return banners**;*
break;
}
}
}
// End -->
</script>
Carregando comentários...