← Javascript

[Pedido] Script Banner Rotativo

Lida 6719 vezes

Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Alguém me consegue arranjar um script banner rotativo para publicidade?

Já andei à procura de alguns, mas são simples como gosto...  Sou esquisito. xD
Offline

Fernando Augusto 
Membro
Mensagens 922 Gostos 0
Feedback +1

Troféus totais: 30
Trófeus: (Ver todos)
Linux User Mobile User Windows User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3

Tenta

Código: [Seleccione]
Banner rotativo. A cada abertura de páginas aparece um banner diferente

<--inicio do código-->

<script language="Javascript">
hoje = new Date()
numero_de_imagens = 3
segundos = hoje.getSeconds()
numero = segundos % numero_de_imagens
if (numero == 0){
banner = "http://www.seusite.com//banner1.gif"
link = "http://www.listfire.com/48897"
alvo = "out"
texto= "Lista livre de spam"
}
if (numero == 01){
banner = "http://www.seusite.com/promobanner03.gif"
link = "http://www.publipt.com/pages/index.php?refid=silviobr"
alvo = "out"
texto= "Ganhe dinheiro lendo e-mail"
}
if (numero == 02){
banner = "http://www.seusite.com/powerlist.gif"
link = "http://www.powerlist.rg8.net/?ID=ganhonline"
alvo = "out"
texto= "Divulgação gratuita"
}
if (numero == 03){
banner = "http://www.seusite.com/megaterremoto2.gif"
link = "http://www.megaterremoto.com/index.asp?ID=sasnews"
alvo = "out"
texto= "Divulgação gratuita"
}
document.write('<a href="' + link + '" target="' + alvo + '"><img src="' + banner + '" alt="' + texto + '" width="468" height="60" border="0"></a>')</script>

<--fim do código-->

As partes em vermelho são as únicas que você deve mexer.(Obs: Não corrija acentuação no código)

ou

Código: [Seleccione]
<script language="JavaScript">
var max = 3;
var nrImages = 3;
function makeImages() {
this[0] = "Link Imagem";
this[1] = "Link Imagem";
this[2] = "Link Imagem";
this.length = nrImages;
}
function makeLinks() {
this[0] = "Link Url";
this[1] = "Link Url";
this[2] = "Link Url";
this.length = nrImages;

}
var vetImages = new makeImages();
var vetLinks = new makeLinks();
var x = Math.round(Math.random()*max);
var y = max / nrImages;
for(var cont = 1;cont*y<= max;cont++) {
if (x <= (cont*y)) {
document.write("<a href="+vetLinks[cont-1]+" target=_blank><img src="+vetImages[cont-1]+" border='0'/></a>");
break;
}
}
</script>
Offline

Fernando Augusto 
Membro
Mensagens 922 Gostos 0
Feedback +1

Troféus totais: 30
Trófeus: (Ver todos)
Linux User Mobile User Windows User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3

Ajudou ou nem por isso
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Obrigado :D

Ajudou

Este tambem é bom:
Citar
<script language="JavaScript">

function TrocaBanner() {

var x = 1;
x = Math.floor(Math.random()*4);

if(x == 1)
{
document.write('<a href="http://www.velame.com" target="_blank"><img border="0" src="http://www.velame.com/banners_site/banner_velame.gif" alt="O conteúdo que você procura está aqui !!!" width="468" height="60" align="middle"></a>');
return(0);
}
else
{
if(x == 2)
{
document.write('<a href="http://www.velame.com/anuncie.html" target="_blank"><img border="0" src="http://www.velame.com/banners_site/banner_publicidade.gif" alt="Anuncie aqui e faça com que seus negócios decolem de vez" width="468" height="60" align="middle"></a>');
return(0);
}
else
{
if(x == 3)
{
document.write('<a href="http://www.construweb.dahora.net" target="_blank"><img border="0" src="http://www.velame.com/banners_site/construweb_468.gif" alt="Adquira seu site por muito menos do que você imagina" width="468" height="60" align="middle"></a>');
return(0);
}
else
{
document.write('<a href="http://www.programadeafiliados.com.br/clique6.asp?id=485&idlink=121&idaff=197" target="_blank"><img src="http://www.velame.com/banners_site/468_60_hot.gif" alt="CLIQUE AQUI e insira gratuítamente a previsão do tempo na sua área de trabalho" width="468" height="60" border="0" align="absmiddle"></a>');
return(0);
}}}}

</script>

<script>TrocaBanner()</script>