Article View: chile.comp.programacion
Article #860Ayuda con JavaScript
From: mcrucesp
Date: Mon, 25 Jun 2007 22:41
Date: Mon, 25 Jun 2007 22:41
55 lines
2906 bytes
2906 bytes
Hola a todos!
Les cuento...tengo este codigo javascript que me hace rotar unas imagenes,
le pone un titulo y funciona como un rotador de banners pero quiero poner 2
o 3 veces el mismo codigo en una pagina, el problema es que al poner mas de
1, no rotan las imagenes, pero si muestra la primera. en realidad no kcho
nada de java, el codigo lo saque de una de esas pagina de copiar y pegar
�hay forma de hacerlo que quiero?
Desde ya muchas gracias por la ayuda :)
codigo:
<script language="JavaScript">
// Copyright 1996, Infohiway, Inc. (http://www.infohiway.com)
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!--
function adArray() {
for (i=0; i*2<adArray.arguments.length; i++) {
this[i] = new Object();
this[i].src = adArray.arguments[i*2];
this[i].href = adArray.arguments[i*2+1];
}
this.length = i;
}
function getAdNum() {
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
return ad_num;
}
var ads = new adArray(
"Images/teatro.jpg","http://planmagic.com",
"Images/nissim.jpg","http://simplythebest.net",
"Images/teatro.jpg","http://simplythebest.net/scripts/");
var ad_num = getAdNum();
document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD
'
+'ALIGN=CENTER><FONT SIZE=1 FACE=Tahoma><B>Inmobiliaria Paumar '
+'</FONT></TD><TR></TR><TD><A HREF="'+ads[ad_num].href+'"><IMG
SRC="'+ads[ad_num].src+'" '
+'WIDTH="200" HEIGHT="120" BORDER=1
name=js_ad></A></TD></TR></TABLE></CENTER>');
link_num = document.links.length-1;
function rotateSponsor() {
if (document.images) {
ad_num = (ad_num+1)%ads.length;
document.js_ad.src = ads[ad_num].src;
document.links[link_num].href = ads[ad_num].href;
setTimeout("rotateSponsor()",5000);
}
}
setTimeout("rotateSponsor()",5000);
// -->
</script>
Technical Details
Message-ID:
<f5pggv$lqg$1@news.nivel5.cl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!news.nivel5.cl!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,57d1d1efdbdb09bf,start X-Google-Attributes: gid1593cb,public,usenet X-Google-Language: SPANISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!news.nivel5.cl!not-for-mail From: "mcrucesp" <mcrucesp@vtr.punto.net> Newsgroups: chile.comp.programacion Subject: Ayuda con JavaScript Date: Mon, 25 Jun 2007 18:41:00 -0400 Organization: Varios Lines: 59 Message-ID: <f5pggv$lqg$1@news.nivel5.cl> NNTP-Posting-Host: pc-72-226-120-200.cm.vtr.net X-Trace: news.nivel5.cl 1182811487 22352 200.120.226.72 (25 Jun 2007 22:44:47 GMT) X-Complaints-To: news@news.nivel5.cl NNTP-Posting-Date: Mon, 25 Jun 2007 22:44:47 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original