Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/01/2004, 14:48
darkoi
 
Fecha de Ingreso: octubre-2003
Mensajes: 46
Antigüedad: 20 años, 6 meses
Puntos: 0
Ojala le sirva a alguién..

Hice un banner rotario para noticias (muestra las últimas 5 con su fecha y linkedas)
Un modesto aporte de un aficionado

<script language="JavaScript1.2">

var ancho=50
var alto=50
var velocidad=3
var contenido='
<?
$ssql=("SELECT *,DATE_FORMAT(fecha,'%d-%m-%Y') AS mi_fecha FROM noticias ORDER BY fecha desc limit 5");
$result=mysql_query($ssql,$conn);
while ($row=mysql_fetch_array($result)){
echo "<a href=noticias/vernoticia.php?idnot=".$row['id_noticia'].">".substr($row[titulo],0,25)."...<br>(".$row[mi_fecha].")</a><br><br>";} ?>'

if (document.all)
document.write('<marquee direction="up" scrollAmount='+velocidad+' style="width:'+ancho+';height:'+alto+'">'+contenid o+'</marquee>')

function regenerar(){
window.location.reload()
}
function regenerar2(){
if (document.layers){
setTimeout("window.onresize=regenerar",450)
inimarquee()
}
}

function inimarquee(){
document.cmarquee01.document.cmarquee02.document.w rite(contenido)
document.cmarquee01.document.cmarquee02.document.c lose()
thelength=document.cmarquee01.document.cmarquee02. document.height
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thel ength*(-1)){
document.cmarquee01.document.cmarquee02.top-=velocidad
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=alto
scrollit()
}
}
window.onload=regenerar2
</script>

Saludos